From: Stanislav Malyshev Date: Wed, 21 Mar 2007 00:24:01 +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 17 18 19 20 Groups: php.internals Request: Send a blank email tointernals+get-28506@lists.php.net to get a copy of this message
$_SCOPE doesn't need to be that special... It can just be an object with overloaded array access... Whenever a dim is fetched for that object, check current_execute_data->prev->symbol_table for the variable and return that.Once again - current_execute_data->prev at *closure runtime* has nothing common with the symbol table that closure is supposed to capture. The symbol table is present at the *closure instantiation* time - i.e. when$foo = function(...) {...} (1)is executed, not when$foo(...) (2)is executed. (1) may be executed in scope entirely unrelated to (2) and only in rare special cases scope (1) would precede scope (2). In many other cases, totally unrelated scope would be predecessor of (2) and getting values from there would be a big surprise to the user.-- Stanislav Malyshev, Zend Products Engineerstas@zend.comhttp://www.zend.com/
Thread (168 messages)
- Wez Furlong
- Jan Lehnardt
- Wez FurlongRe: PATCH: anonymous functions in PHP
- Stanislav Malyshev
- Wez Furlong
- Stanislav Malyshev
- Christian Schneider
- Sean Coates
- Stanislav Malyshev
- Sean Coates
- Wez Furlong
- Sean Coates
- Stanislav Malyshev
- Robert Cummings
- Stanislav Malyshev
- Robert Cummings
- Stanislav Malyshev
- Robert Cummings
- Stanislav Malyshev
- Robert Cummings
- Andi GutmansRE: [PHP-DEV] PATCH: anonymous functions in PHP
- Stanislav MalyshevRe: PATCH: anonymous functions in PHP
- Wez FurlongRe: PATCH: anonymous functions in PHP
- Sean Coates
- Wez Furlong
- Richard Lynch
- Richard Lynch
- David Zülke
- Antony Dovgal
- Sebastian Bergmann
- Richard Lynch
- Andrei Zmievski
- troels knak-nielsenRe: PATCH: anonymous functions in PHP
- Stanislav MalyshevRe: Re: PATCH: anonymous functions in PHP
- troels knak-nielsen
- Stanislav Malyshev
- Lars Strojny
- Alexey Zakhlestin
- troels knak-nielsen
- Jeff Moore
- Larry Garfield
- Jeff Moore
- Larry Garfield
- Christian SeilerPATCH: Implementing closures in PHP (was: anonymous functions in PHP)
- Alexey Zakhlestin
- Antony DovgalRe: Re: PATCH: anonymous functions in PHP
- Ryusuke SEKIYAMARe: PATCH: Implementing closures in PHP
«previous | php.internals (#28506) | next » |
---|