Anonymous functions, implemented in PHP 5.3, yield objects of this type. This fact used to be considered an implementation detail, but it can now be relied upon. Starting with PHP 5.4, this class has methods that allow further control of the anonymous function after it has been created.

• Enable creation of functions without specifying a name

• Implemented using the closure class

• Commonly used as param value for callback functions, or alternatively as variable values

• To inherit variables from parent scope (function in which closure was declared), these variables must be declared in the function header with the “USE” keyword, or passing parameters in the call line

• new closure TYPE HINT

Leave a Reply

Your email address will not be published. Required fields are marked *