superbiche
6/30/2015 - 10:33 AM

Pass by reference with call_user_func

Pass by reference with call_user_func

// won't work with call_user_func, but with call_user_func_array it does!
$args = 'blah';

call_user_func_array('some_function', array(&$args));

function some_function(&$string) {
  $string = 'blow';
}

echo $args;

// output: blow