public function getIterator() { $limit = $this->limit; foreach ($this->source as $key => $value) { if (--$limit < 0) { return; } (yield $key => $value); } }