You need to set the variable equal to the result of the function, like so...
$b = call_user_func('test', $b);
and the function should be written as follows...
function test($a) {
...
return $a
}
The other pass by reference work-a-rounds are deprecated.