|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-24 10:09 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 23 21:00:01 2025 UTC |
Description: ------------ PHP 4.x.x, returned value by reference, assign to variable reference. But 5.x.x assign copy of value... Reproduce code: --------------- function &ret_ref(&$arr) { return $arr; } $arr = array("111111", "2222222", "33333333"); $test = ret_ref($arr); $test[] = "4444444444"; print_r($arr); Expected result: ---------------- Array ( [0] => 111111 [1] => 2222222 [2] => 33333333 [3] => 4444444444 ) Actual result: -------------- Array ( [0] => 111111 [1] => 2222222 [2] => 33333333 )