of the function. Again, this would be created based on the $_SCOPES fixup information, and again, $_SCOPES['i'] would be rewritten as simply $i in the op_array.
So the funcs array might look like this is var_dump()'d:
0 => callable('__anon_0', array('i' => 0)),
1 => callable('__anon_0', array('i' => 1)),
2 => callable('__anon_0', array('i' => 2))
How do you know it's 'i'? Does it mean compiler should record any reference to _SCOPES? What if I do $_SCOPES[$foo] - is it that unthinkable? What if I doo $a = "_SCOPES", $$a[$foo]?
Only way I see you can really do it is to explicitly declare the imported variables, otherwise you'll lose them - PHP is too dynamic for compiler to be able to statically resolve it.
On a side note: why one needs callable type? What can be done with it which can't be done with string and $string()?
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/