Re: variable variables in global - bug?
| From: | pollita@php.net | Date: | Wed, 02 Apr 2003 04:13:56 +0000 |
| Subject: | Re: variable variables in global - bug? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-581@lists.php.net to get a copy of this message | ||
> It was brought to my attention that this code is legal in PHP 4:
>
> function foo($param = 'test')
> {
> global $$param;
> echo $$param;
> }
>
> $test = 'bar';
> foo(); // prints bar
>
> Is this a feature or a bug? (Should we support this syntax in
> phpDocumentor, or might it change in php 5?)
>
It's a feature, and it ain't goin' nowhere.