Re: PATCH: anonymous functions in PHP

From: Date: Tue, 20 Mar 2007 19:38:12 +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 to internals+get-28493@lists.php.net to get a copy of this message
FWIW, this doesn't work with the other superglobals (in function context): sean@sarcasm:~$ php -r '$_GET["foo"] = "bar"; function baz() { $get = "_GET"; return ${$get}["foo"]; } $get = "_GET"; echo ${$get}["foo"], baz(), "\n";' bar Notice: Undefined variable: _GET in Command line code on line 1 (this is documented)
Ouch... ok. But $_SCOPES[$foo] should work, shouldn't it? -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

« previous php.internals (#28493) next »