On Wed, Aug 29, 2012 at 6:21 PM, Jared Williams <jared.willia...@ntlworld.com> wrote: > > >> -----Original Message----- >> From: Nikita Popov [mailto:nikita....@gmail.com] >> Sent: 25 August 2012 17:11 >> To: PHP internals >> Subject: [PHP-DEV] [VOTE] Generators >> >> Hi internals! >> >> I think the generators RFC has been discussed thoroughly >> enough by now, so I opened the vote: >> >> https://wiki.php.net/rfc/generators#vote >> >> Thanks, >> Nikita >> > > Hi, > Just discovered another seg fault. > When iterating over a generator that returns references twice it > causes a seg fault. > > function &bind(array $keys, array &$row) > { > foreach($keys as $key) > yield $key => $row[$key]; > } > > $row = []; > $it = bind(['a', 'b'], $row); > > foreach($it as $key => &$ref) > echo $key; > echo "\n"; > foreach($it as $key => &$ref) > echo $key;
Thanks, this is now fixed. It'll throw an exception now, saying that you can't traverse an already closed generator. Nikita -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php