Here it works (I don't know why):
$a = array('a' => 1) $a['a'] = &$a['b'];
In this case, either a reference to $a['a']
, or $a['a']
o_O itself is written to $ a ['b']. Ampersand should be removed — that's all, an error of an undeclared index b
.
Why is this so?
$a
reference toNULL
([ideone.com
] [1]), and when you remove an ampersand, the interpreter tries to access a cell that does not exist, hence the error. [1]: ideone.com/NCb9AW - Opalosolo