To pass a variable by reference in php5 you need to have &
on your function declaration. NOT when you are calling the function.
function call_user_func($param1, &$param2) {
// $param2 will be a reference
// as mentioned by damianb though objects are by default references
// http://php.net/manual/en/language.oop5.references.php
}
when calling this just pass in your params as normal and param2 will be passed by reference.
http://php.net/manual/en/language.references.pass.php
The above link clearely explains the error.
Note: There is no reference sign on a function call - only on function
definitions. Function definitions alone are enough to correctly pass
the argument by reference. As of PHP 5.3.0, you will get a warning
saying that "call-time pass-by-reference" is deprecated when you use &
in foo(&$a);.