在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/PHP  動漫/ 請問這段代碼有啥問題?

請問這段代碼有啥問題?

為啥我遞歸遍歷,然后獲取不到值了?

public function aaaaAction() {
    $a = $this->test([],0);
    $this->newLog(__FUNCTION__,"aaa","測試",json_encode($a));
}
public function test($result,$a) {
    if($a < 200) {
        $a++;
        array_push($result,"123");
        $this->test($result,$a);
    } else {
        $ccc = $result;
        $this->newLog(__FUNCTION__,"aaa","嘿嘿嘿",json_encode($result));
        return $ccc;
    }
}
回答
編輯回答
影魅

這是PHP?
我一個菜逼前端 BB一句?
是不是 $this 指向的問題?

2018年8月22日 21:58
編輯回答
北城荒
$this->test($result,$a);

改為

return $this->test($result,$a);
2017年1月26日 16:32