## 匿名函数 匿名函数(Anonymous functions),也叫闭包函数(closures),允许 临时创建一个没有指定名称的函数。最经常用作回调函数(callback)参数的值。当然,也有其它应用的情况。 ```php // 无参数 $fun = function (){ return 'this is test func'; }; echo $fun(); // 有参数 $fun02 = function ($name){ return 'this is test func '.$name; }; echo $fun02('Tinywan'); // create_function() $fun03 = create_function('','echo "this is create_function";'); echo $fun03(); // this is create_function // 系统函数 $tmp_arr2 = [2, 4, 6, 8]; $res2 = array_map(function ($v) { return $v * 2; }, $tmp_arr2); print_r($res2); ```