Re: PATCH: anonymous functions in PHP

From: Date: Mon, 19 Mar 2007 22:03:54 +0000
Subject: Re: PATCH: anonymous functions in PHP
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Groups: php.internals 
Request: Send a blank email to internals+get-28461@lists.php.net to get a copy of this message
So what this does is compile the "anonymous function" at compile-time, but when this line is executed (note, this line of code should also be reached during execution), then we do the fix-up for $_SCOPE variables.
Yes, this is basically what Wez was proposing I guess. This would require new hashtable for _SCOPE (and/or adding _SCOPE elements on execution of anon-func line) in the function run-time data.
Thoughts?
This might work, still not sure if we really want that in PHP. On one side, it's cool, on other side closures can develop into a very messy code :) -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

« previous php.internals (#28461) next »