Archive for the ‘PHP’ Category

PHP: Pass an array by reference to a callback

If you try call_user_func($callback, &$array) you’ll get “Call-time pass-by-reference has been deprecated”.

The solution is to use call_user_func_array($callback, array(&$array)).

Advertisements