Re: call_user_func and call-time pass-by-reference

From: Date: Thu, 08 Jul 2004 16:00:08 +0000
Subject: Re: call_user_func and call-time pass-by-reference
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-189974@lists.php.net to get a copy of this message
Great, i must have done something wrong, it works for me now. Thanks for all your help :) Andrew Tom Rogers wrote:
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?


« previous php.general (#189974) next »