#45354 [Opn->Bgs]: Referencing variable variables impossible
| From: | vrana@php.net | Date: | Wed, 05 Nov 2008 11:02:22 +0000 |
| Subject: | #45354 [Opn->Bgs]: Referencing variable variables impossible | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-1357@lists.php.net to get a copy of this message | ||
ID: 45354
Updated by: vrana@php.net
Reported By: Sjon at react dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5.2.6
New Comment:
$y_{$a} itself is not documented and it's such a weird construction
that it is undocumented by purpose.
Previous Comments:
------------------------------------------------------------------------
[2008-06-25 12:57:32] Sjon at react dot com
Description:
------------
It seems to be impossible to create a reference to a variable variable,
even though this is not documented anywhere as a known bug or limitation
Reproduce code:
---------------
$y_a=array();
$a='a';
$x =& $y_{$a}; #DOES NOT WORK
# $x =& $y_a; #DOES WORK
$x['c'] = 'd';
var_dump($y_a);
Expected result:
----------------
array(1) {
["c"]=>
string(1) "d"
}
Actual result:
--------------
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45354&edit=1