1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-08 07:46:46 +02:00

Clarify anonymous functions as callbacks as arguments

This commit is contained in:
Malcolm Fell
2013-06-28 09:15:50 +12:00
parent be46dc081a
commit e051d0ec65

View File

@@ -330,7 +330,11 @@ $function_name(); // will execute the my_function_name() function
Similar to variable functions, functions may be anonymous. Similar to variable functions, functions may be anonymous.
```php ```php
my_function(function () { function my_function($callback) {
$callback('My argument');
}
my_function(function ($my_argument) {
// do something // do something
}); });