Bug #13363: variable variables with arrays
| From: | developer at jaaboo dot com | Date: | Tue, 18 Sep 2001 11:50:44 +0000 |
| Subject: | Bug #13363: variable variables with arrays | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-66181@lists.php.net to get a copy of this message | ||
From: developer@jaaboo.com
Operating system: all
PHP version: 4.0.6
PHP Bug Type: Scripting Engine problem
Bug description: variable variables with arrays
$dynvar = "GLOBALS[first][second]";
echo $$dynvar;
result : nothing , no error and no output!
for arrays stored in variables only to ways are working:
$dynvar = "GLOBALS";
echo ${$dynvar[first][second]};
or more dynamic but more slower!
$dynvar = "<"."?PHP echo \$GLOBALS[first][second]; ?".">";
eval $dynvar;
you can use a variable to store instead of echo!
I think this breaks the rules of assigning variable variables . It must be
possible to store the complete call of the array in a variable.
The Way implemented jet is not praktical!!!!! Real World Tested! There are
so much postings in many Forums and Mailinglist with no suggestion . I
can't understand this! So i must think this is a BUG! or was forgotten to
realize!
--
Edit bug report at: http://bugs.php.net/?id=13363&edit=1