|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-24 08:58 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 23:00:01 2025 UTC |
Description: ------------ Call-time pass-by-reference for non-object Variables is Deprecated? We can use word "new" with Call-time pass-by-value for object,but how to use pass-by-reference in Call-time for non-object Variables like int,string,array? Reproduce code: --------------- $a=1; $b=$a; $c=&$a; $a='cc'; tt($c); echo $b."<BR/>"; echo $c."<BR/>"; echo "pass by value"."<BR/>"; tt(&$c); echo $b."<BR/>"; echo $c; function tt($aa){ $aa="erety"; } Expected result: ---------------- Deprecated: Call-time pass-by-reference has been deprecated in F:\Programming\Web\php\mykernel\test\arg\fun_ref_time.php on line 11 1 cc pass by value 1 eretyPHP Deprecated: Call-time pass-by-reference has been deprecated in F:\Programming\Web\php\mykernel\test\arg\fun_ref_time.php on line 11 Actual result: -------------- how can i used Call-time pass-by-value for non-object Variables ?