summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMalcolm Fell <malcolm@vendhq.com>2013-06-28 09:15:50 +1200
committerMalcolm Fell <malcolm@vendhq.com>2013-06-28 09:15:50 +1200
commite051d0ec65dfbf7b97324e6b4e4812afd5a3dd03 (patch)
treea593f8651dad4c90224031da881f358272dddc1a
parentbe46dc081a255d85a1b1331b4fcd949196699b7c (diff)
Clarify anonymous functions as callbacks as arguments
-rw-r--r--php.html.markdown6
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
});