|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-12-12 05:52 UTC] sniper@php.net
[2002-12-12 09:11 UTC] minakov at bas-net dot by
[2002-12-12 11:19 UTC] sniper@php.net
[2003-01-02 18:46 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 15:00:01 2025 UTC |
let the sample code say the problem <? function &Ref_Bad(&$arr) { return true ? $arr : $arr; } function &Ref_Good(&$arr) { if (true) return $arr; else return $arr; } $arr = array('a' => '1'); $arr_bad =& Ref_Bad($arr); $arr_good =& Ref_Good($arr); $arr_bad['b'] = 2; $arr_good['c'] = 3; print_r($arr); ?> required result: Array ( [a] => 1 [b] => 2 [c] => 3 ) current result: Array ( [a] => 1 [c] => 3 )