PHP闭包

未结帖
0 1458
ajian frank 2014-06-17
悬赏:5飞吻

点击这里

public function ddd($Model){
    $data1 = 2225;
    $allFunction = array();
    $allFunction['func1'] = function($Model) use(&$data1){
        echo $data1;
        $data1++;
    };

    $allFunction['func2'] = function()use(&$data1){
        echo "dfgdh".$data1;
    };

    return $allFunction;
}


热忱回答0


最近热帖

近期热议

  1. javascript——prototype与__proto 9
  2. Mysql 中出现的Data truncated for column 3
  3. 在nginx中使用x-sendfile的解决方案 3
  4. 高版本jQuery面插件实现Ajax上传图片 1
  5. Thinkphp Socket.class.php 类的使用 1
  6. 使用ionic3创建第一个App 0
  7. ios-oc html5 0
  8. nginx.conf 0
  9. 基于ionic3.4.0的项目搭建 0
  10. php 缩略图 0