ID: 40959 Updated by: [EMAIL PROTECTED] Reported By: mamay55 at gmail dot com -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux/Windows PHP Version: 5.2.1 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: ------------------------------------------------------------------------ [2007-03-30 14:41:46] mamay55 at gmail dot com Description: ------------ Whenever a function (global or class method) returns a reference to an array element which is not set, the value of that element is set to null. Reproduce code: --------------- $data = array(); function &get_data($key) { global $data; return $data[$key]; } print_r($data); $result = &get_data('TEST'); echo $result; print_r($data); Expected result: ---------------- The expected result would be that the value of the unset element would not be set and the following warning would be produced: Undefined index: TEST in ... Actual result: -------------- Array ( ) Array ( [TEST] => ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40959&edit=1