A php closure or anonymous function is used to create function without specifying its name.
Is it possible to call them without assigning to identifier as we do in J
PHP 7 added the ability to do this.
This code:
(function() { echo "This works as expected in PHP 7.\n"; })();
works as one would expect in PHP 7. (It still doesn't work in any PHP 5.x. release)