public function __construct(\Generator $g, $yield_key = null) { $this->g = $g; $this->h = spl_object_hash($g); $this->yieldKey = $yield_key; $this->valid(); }