Selepas mengikuti, anda boleh menjejaki maklumat dinamiknya tepat pada masanya
Kursus dalam bahagian yang berkaitan:Fungsi tersuai PHP fungsi tanpa nama
匿名变量没有函数名,通过变量加上括号来调用,这就是匿名函数 <?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个赞