Page 1 of 1

Passing Parameters By Reference to Callback Function

Posted: Sun Jun 15, 2008 2:50 pm
by mikeym
Hi,

Is it possible to pass a parameter by reference to a callback function?

PS I'm using PHP 4.4.2

Re: Passing Parameters By Reference to Callback Function

Posted: Sun Jun 15, 2008 2:54 pm
by John Cartwright
How are you applying the callback?

Code: Select all

call_user_func_array('function', array(&$foobar));

Re: Passing Parameters By Reference to Callback Function

Posted: Sun Jun 15, 2008 4:35 pm
by Ambush Commander
Use Jcart's syntax. If the function def has the ref, but not the callback, the variable is not passed by reference.

Re: Passing Parameters By Reference to Callback Function

Posted: Mon Jun 16, 2008 3:54 am
by mikeym
Thanks that worked.