Re: Generators in PHP
| From: | Ivan Enderlin @ Hoa | Date: | Wed, 06 Jun 2012 10:20:57 +0000 |
| Subject: | Re: Generators in PHP | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60757@lists.php.net to get a copy of this message | ||
On 05/06/12 19:35, Nikita Popov wrote:
Hi internals! Hi Nikita,
Before going any further I'd like to get some comments about what you think of adding generator support to PHP. I have always hoped to see the “yield” keywork introduced in PHP. I even suggested that in this mailing-list at least one time but I'm very glad to see some patches coming out.In addition to Gustavo's remarks, I wonder how the GC would collect a Generator object that is not use anymore (especially with a referenced yield). Does it fit to the current CG strategy or do we need an extra strategy? I would notice that the “Yield by reference” section does not exist but you have targeted it). Moreover, I wonder how a “recursive yield” would act (something like “public function *f ( … ) { … yield $this->f(…); … }”). It is possible? Is it anticipated? Thanks for you work. Cheers. -- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/