Skip to content

Commit

Permalink
Clarify anonymous functions as callbacks as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolm Fell committed Jun 27, 2013
1 parent be46dc0 commit e051d0e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion php.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit e051d0e

Please sign in to comment.