mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Clarify reason for variable functions, and suggest core language alternative
This commit is contained in:
parent
51fc13d2c1
commit
c00b70c5f6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user