Hi,
Is it possible to pass a parameter by reference to a callback function?
PS I'm using PHP 4.4.2
Passing Parameters By Reference to Callback Function
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Passing Parameters By Reference to Callback Function
How are you applying the callback?
Code: Select all
call_user_func_array('function', array(&$foobar));- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Re: Passing Parameters By Reference to Callback Function
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
Thanks that worked.