|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-29 14:12 UTC] moriyoshi@php.net
[2003-10-29 19:45 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 00:00:02 2025 UTC |
Description: ------------ When passing a non-existing portion of an array by reference this portion gets created even if the function does not touch the array => it is modified in the calling line. It works with string indexes as well. Reproduce code: --------------- error_reporting(E_ALL); $tab2 = array( ); function do_nothing ( &$var ) { // code here doesnt matter } do_nothing($tab2[10]); var_dump($tab2); Expected result: ---------------- array(0) { } Actual result: -------------- array(1) { [10]=> NULL }