<?php
function j($a){
if($a==1){
return 1;
}else{
return $a*j($a-3);
}
}
echo j(7);
当输入 7 时正常输出结果 28, 输入其他数字当执行 else 语句时就会报错
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in D:\phpStudy\PHPTutorial\WWW\Qos\test.php on line 6
如果把$a==1 中的值改成其他的数字连输入 7 都会报错,这是为什么呢?
求大神说明下这是什么原因造成的呢
function j($a){
if($a==1){
return 1;
}else{
return $a*j($a-3);
}
}
echo j(7);
当输入 7 时正常输出结果 28, 输入其他数字当执行 else 语句时就会报错
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in D:\phpStudy\PHPTutorial\WWW\Qos\test.php on line 6
如果把$a==1 中的值改成其他的数字连输入 7 都会报错,这是为什么呢?
求大神说明下这是什么原因造成的呢