dream1849 2016-08-12 09:44
浏览 93
已采纳

无法执行变量php中返回的函数

I have a function with this syntaxe :

$variable = function() {
    return function(){
        //code
    }
}

I can't execute that function with

$variable()

Is there a way to execute this function ?

  • 写回答

4条回答 默认 最新

  • dongxinjun3944 2016-08-12 09:48
    关注

    I don't know for what is it... But here example:

    $a = function () {
       return function () { 
           return 1; 
       };
    };
    $b = $a();
    echo $b();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?