#49940 [Opn->Bgs]: Variable variables don't work with multi-arrays
| From: | jani@php.net | Date: | Wed, 21 Oct 2009 10:16:54 +0000 |
| Subject: | #49940 [Opn->Bgs]: Variable variables don't work with multi-arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143750@lists.php.net to get a copy of this message | ||
ID: 49940
Updated by: jani@php.net
Reported By: contact at piry dot net
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Vista
PHP Version: 5.2.11
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2009-10-21 08:53:56] contact at piry dot net
Description:
------------
The Variable variables in PHP don't work properly with multi-arrays.
You should be able to display the value from an array key by joining
the multi-array variable and the keys.
Reproduce code:
---------------
$results['rss']['channel']['item'][0]['title'] = "Hello
there";
$a = "results";
$b = "['rss']['channel']['item'][0]['title']";
echo ${$a.$b};
Expected result:
----------------
I expect it to display "Hello there";
Actual result:
--------------
Undefined variable:
results['rss']['channel']['item'][0]['title']
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49940&edit=1