public function __call($method, $args) { if ($method === 'throw') { if (!$this->generator) { $this->rewind(); } return $this->generator->throw(...$args); } else { // trigger normal undefined method error return $this->{$method}(...$args); } }