call_user_function?
Posted: Tue Dec 20, 2011 1:42 pm
Can someone explain to me what the point of call_user_function is?
What is the difference between:
and
Why would I want to use a function to call my functions when they can be called directly?
What is the difference between:
Code: Select all
function increment(&$var)
{
$var++;
}
$a = 0;
call_user_func('increment', $a);
echo $a."\n";
Code: Select all
function increment($var)
{
$var++; return($var);
}
$a = 0;
echo increment($a) ."\n";