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

From: Date: Wed, 07 Jul 2004 17:38:41 +0000
Subject: Re: call_user_func and call-time pass-by-reference
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-189887@lists.php.net to get a copy of this message
Tom Rogers wrote:
Sorry about that, I checked it in cli and it doesn't give a warning. This is another way: function fun($arg) {
        $arg++;
} $var = 0; call_user_func_array("fun", array(&$var)); echo $var;
Hmm ... this still echos 0 and not 1. I am using 4.3.7 with all warnings on. Does anyone know how to use this function or anything similiar with passing by refernce. Since the call-time pass by reference is deprecated, this practice is no longer valid, but there must be a work around? Thanks for any assistance Andrew

« previous php.general (#189887) next »