1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-29 11:20:21 +01: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.
```php
my_function(function () {
function my_function($callback) {
$callback('My argument');
}
my_function(function ($my_argument) {
// do something
});