vec
关注他

关注后可及时了解他的动态信息

课程笔记
  • 所属章节课程:php自定义函数之匿名函数

    匿名变量没有函数名,通过变量加上括号来调用,这就是匿名函数 <?php function Myself($one,$two,$func){ //Rules that examine if is function,if isn't a function cease this piece of code and return false if(!is_callable($func)){ return false; } // let $one plus $two ,and then pass $one and $two into this function and excute it // $func is a varibale function echo $one+$two+$func($one,$two); } Myself(20,30,function($foo,$bar){ $result=($foo+$bar)*2; return $result; }); ?> 回调式的匿名函数就是回调时调用的函数是没有函数名的匿名函数

    2018-08-200个赞