From e051d0ec65dfbf7b97324e6b4e4812afd5a3dd03 Mon Sep 17 00:00:00 2001 From: Malcolm Fell Date: Fri, 28 Jun 2013 09:15:50 +1200 Subject: Clarify anonymous functions as callbacks as arguments --- php.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'php.html.markdown') 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 }); -- cgit v1.2.3