为了账号安全,请及时绑定邮箱和手机立即绑定

请问这段代码有啥问题?

请问这段代码有啥问题?

PHP
喵喵时光机 2019-03-09 15:28:11
为啥我递归遍历,然后获取不到值了? 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; } }
查看完整描述

2 回答

?
慕桂英3389331

TA贡献2036条经验 获得超8个赞

$this->test($result,$a);

改为

return $this->test($result,$a);
查看完整回答
反对 回复 2019-03-18
  • 2 回答
  • 0 关注
  • 465 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信