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/