Re[2]: [PHP] call_user_func and call-time pass-by-reference

From: Date: Wed, 07 Jul 2004 23:44:48 +0000
Subject: Re[2]: [PHP] call_user_func and call-time pass-by-reference
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-189926@lists.php.net to get a copy of this message
Hi, Thursday, July 8, 2004, 3:38:41 AM, you wrote: AN> Hmm ... this still echos 0 and not 1. I am using 4.3.7 with all AN> warnings on. AN> Does anyone know how to use this function or anything similiar with AN> passing by refernce. Since the call-time pass by reference is AN> deprecated, this practice is no longer valid, but there must be a work AN> around? AN> Thanks for any assistance AN> Andrew Strange as it works for me (http://fred.kwikin.com/user.php) with this code exactly: <?php function fun($arg) { $arg++; } $var = 0; echo "Before:$var<br>"; call_user_func_array("fun", array(&$var)); echo "After:$var<br>"; ?> What version of PHP are you using? -- regards, Tom

« previous php.general (#189926) next »