diff options
author | Malcolm Fell <malcolm@vendhq.com> | 2013-06-28 09:15:50 +1200 |
---|---|---|
committer | Malcolm Fell <malcolm@vendhq.com> | 2013-06-28 09:15:50 +1200 |
commit | e051d0ec65dfbf7b97324e6b4e4812afd5a3dd03 (patch) | |
tree | a593f8651dad4c90224031da881f358272dddc1a /php.html.markdown | |
parent | be46dc081a255d85a1b1331b4fcd949196699b7c (diff) |
Clarify anonymous functions as callbacks as arguments
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/php.html.markdown b/php.html.markdown index ae636b0a..af4e2f01 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -330,7 +330,11 @@ $function_name(); // will execute the my_function_name() function Similar to variable functions, functions may be anonymous. ```php -my_function(function () { +function my_function($callback) { + $callback('My argument'); +} + +my_function(function ($my_argument) { // do something }); |