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" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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.
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to