Skip to content

Instantly share code, notes, and snippets.

@michaldudek
Last active December 20, 2015 06:48
Show Gist options
  • Save michaldudek/6088093 to your computer and use it in GitHub Desktop.
Save michaldudek/6088093 to your computer and use it in GitHub Desktop.
Anonymous function test
$function = function($n) {
return function($i) use ($n) {
return $i + $n;
};
};
echo gettype($function);
echo gettype($function(1));
$result = $function(2);
echo gettype($result);
echo gettype($result(5));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment