ID: 48121 Updated by: [email protected] Reported By: feldkamp at gameforge dot de -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Debian Etch 2.6.26 PHP Version: 5.2.9 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 $a =& $foo[]; Where =& means that both $a and $foo[<next index>] should point to same place, and in your example they both point to null so: var_dump($a, $foo); Outputs: NULL array(1) { [0]=> &NULL } For more info: http://www.php.net/manual/en/language.references.whatare.php Previous Comments: ------------------------------------------------------------------------ [2009-04-30 13:51:57] feldkamp at gameforge dot de Description: ------------ Using array-operator to access a non-existing key of a referenced variable turns variables that are false or an empty string into arrays. Reproduce code: --------------- <? $abc = false; // or '' var_dump($abc); $a = &$abc['unsetKey']; var_dump($abc); ?> Expected result: ---------------- Warning: Cannot use a scalar value as an array Actual result: -------------- boolean false array 'unsetKey' => null ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48121&edit=1
