Re: call_user_func problem

From: Date: Mon, 03 Dec 2001 13:21:14 +0000
Subject: Re: call_user_func problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-76373@lists.php.net to get a copy of this message
Hi, just do it like this - the result will be the same, and $bar is still passed by reference: ________________ $result = call_user_func("foo", $bar); function foo( &$bar ) { $bar .= 'foobar'; return 1; } _________________ This error just tells you, that you have to declare "pass-by-reference" in your functions, and cannot use a "generic" function, that sometimes takes parameters by reference and sometimes by value. This problem has nothing to do with "call_user_func()". "C" <C@C.C> schrieb im Newsbeitrag news:20011201072734.47539.qmail@pb1.pair.com... > Prior to 4.0.6 it worked fine, however, now when I try: > > $result = call_user_func("foo", &$bar); > > function foo( &$bar ) { > $bar .= 'foobar'; > return 1; > } > > I get this: > > Warning: Call-time pass-by-reference has been deprecated - argument passed > by value; If you would like to pass it by reference, modify the declaration > of call_user_func(). If you would like to enable call-time > pass-by-reference, you can set allow_call_time_pass_reference to true in > your INI file. However, future versions may not support this any longer. > > Does that mean I can't pass by reference anymore? I kinda need to (the two > functions above are not my actual functions btw).... > > Thanks. > >

« previous php.general (#76373) next »