RE: [PHP-DEV] [VOTE] Generators

From: Date: Wed, 29 Aug 2012 16:21:50 +0000
Subject: RE: [PHP-DEV] [VOTE] Generators
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-62581@lists.php.net to get a copy of this message
> -----Original Message----- > From: Nikita Popov [mailto:nikita.ppv@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; Jared

« previous php.internals (#62581) next »