035-PHP defines a simple closure function

<? PHP
 / * 
 + What is the closure function? I.e., an internal function, comprising the anonymous functions 1-N, 
 + usefulness can be done to achieve a local data cache and package (somewhat similar class) 
* / 
    # internal function, define an anonymous function, referred to as the closure function to 
    function Demo () 
    { 
        $ FUNC = function () {
             echo "I love PHP" ; 
        }; 
        $ FUNC (); 
    } 
    
    # calling test 
    Demo ();
 ?>

 

Guess you like

Origin www.cnblogs.com/tianpan2019/p/10993316.html