A basic promise implementation in PHP