Re: Generators in PHP

From: Date: Fri, 20 Jul 2012 20:46:13 +0000
Subject: Re: Generators in PHP
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-61579@lists.php.net to get a copy of this message
On Tue, Jun 5, 2012 at 7:35 PM, Nikita Popov <nikita.ppv@googlemail.com> wrote: > Hi internals! > > In the last few days I've created a proof of concept implementation > for generators in PHP. It's not yet complete, but the basic > functionality is there: > https://github.com/nikic/php-src/tree/addGeneratorsSupport > > The implementation is outlined in the RFC-stub here: > https://wiki.php.net/rfc/generators A small progress update on this: * There now is support for yield by reference * Generators are now automatically detected by the presence of "yield" instead of requiring the "*" modifier. The main open point I still have is whether or not generators should have a throw() method (á la Python). I couldn't yet find a convincing use case for it, so I'm considering to just leave it out. If there is any further feedback on the proposal, I'd love to hear it :) Nikita

« previous php.internals (#61579) next »