Bug #8860 Updated: variable array not working
| From: | jimw@php.net | Date: | Sat, 27 Apr 2002 18:25:08 +0000 |
| Subject: | Bug #8860 Updated: variable array not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-6257@lists.php.net to get a copy of this message | ||
ID: 8860
Updated by: jimw@php.net
Reported By: wico@cnh.nl
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: linux
PHP Version: 4.0.4pl1
New Comment:
you need to use eval() to make something like this unambiguous.
Previous Comments:
------------------------------------------------------------------------
[2001-01-23 10:25:22] stas@php.net
It is definitely not meant to work this way. 'test[2]' is
not a variable name. $test is the variable (array), and
$test[2] is second element of the array. So it belongs to
feature requests.
------------------------------------------------------------------------
[2001-01-23 10:20:59] cynic@php.net
ah, sorry, should've read the report more carefully.
------------------------------------------------------------------------
[2001-01-23 10:07:21] wico@cnh.nl
changed status
------------------------------------------------------------------------
[2001-01-23 10:06:24] wico@cnh.nl
ok and that isn;t working either...
althoug i liked the first more (and still think it should be that way)
so this doesn't work either:
$three = "Grrrr";
echo "Test";
$test = Array("one","two","three","four"); $var =
'test[2]'; echo
$$var; /* should echo "three" */
------------------------------------------------------------------------
[2001-01-23 09:59:43] cynic@php.net
no. it will echo contents of $three. if you don't have that variable in
current scope, it'll echo null, and, depending on your settings, emit a
warning.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/8860
--
Edit this bug report at http://bugs.php.net/?id=8860&edit=1