Clarify reason for variable functions, and suggest core language alternative

This commit is contained in:
Malcolm Fell 2013-06-30 12:37:32 +12:00
parent 51fc13d2c1
commit c00b70c5f6

View File

@ -363,7 +363,8 @@ $bar('C'); // Prints "A - B - C"
// You can call named functions using strings
$function_name = 'add';
echo $function_name(1, 2); // => 3
// But, you should probably use anonymous functions instead.
// Useful for programatically determining which function to run.
// Alternatively, use call_user_func(callable $callback [, mixed $parameter [, mixed $... ]]);
/********************************
* Classes