Re: Re: Bug #16687 Updated: Constants not being interpreted in "variable variables"

From: Date: Sat, 20 Apr 2002 19:54:55 +0000
Subject: Re: Re: Bug #16687 Updated: Constants not being interpreted in "variable variables"
References: 1 2 3 4 5 6 7  Groups: php.dev 
Request: Send a blank email to php-dev+get-83072@lists.php.net to get a copy of this message
At 20:33 20/04/2002 +0300, Zeev Suraski wrote:
It applies, to a degree. If you directly reference $GLOBALS anywhere in your function, you can also reference it indirectly. If you don't, however, indirect reference won't work. E.g., function foo() {
        $foo = "GLOBALS";
        print $$foo["bar"];             // won't work
} function foo() {
        $GLOBALS;
        $foo = "GLOBALS";
        print $$foo["bar"];             // will work
} That's a side effect of implementation, though, so I think it's best to say that indirect reference to $GLOBALS is not supported.
Yes, I also think we should document that indirect references to $GLOBALS shouldn't be used. It might change. Andi

« previous php.dev (#83072) next »