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

From: Date: Wed, 07 Jul 2004 17:44:21 +0000
Subject: Re: call_user_func and call-time pass-by-reference
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-189888@lists.php.net to get a copy of this message
Curt Zirzow wrote:
* Thus wrote Andrew Nagy:
How do you use the call_user_func function with call-time pass-by-reference deprecation? For example: function fun(&$arg) { $arg++; } $var = 0; call_user_func("fun", $var); echo $var; //echoes 0 instead of 1
$func_call = 'fun'; $func_call($var); Curt
This does not do what I need. I need to be able to call a dynamic function name and pass in the parameters with the &. The problem is this syntax is now deprecated. your example with the &: $func_call = 'fun'; $func_call(&$var); throughs a warning of the deprecation of this syntax. Any ideas?

« previous php.general (#189888) next »