Well, the compiler would make a list of variables names to import and store those in the zend_function structure. Then at the time the function is bound (in response to a DECLARE_FUNCTION opcode), the variable reference could be fixed up in the "same" way that global is handled.
Global is not handled this way. Global creates reference at runtime (i.e. when function is *executed*) to runtime variable in global space. However, binding to compile scope can't work as globals do - since binding should happen at "definition run-time" - e.g., when the function definition is used. Adding binding capabilities to DECLARE_FUNCTION might work though, but it is not clear what to do in case this is declared in a loop (then it can't really be done compile-time unless we clone this function each time). It must be also considered how these values are added to the function symbol table when the function runs - e.g. are they references or copies?
-- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php