class jrrecharge
{
function preDonePayInterest($borrowerUid, $loanId, $step, $saleNo) {
return $this->mod('jrrecharge')->preDonePayInterest($borrowerUid, $loanId, $step, $saleNo);
}
简单测试:
<?php
class classA
{
public function __construct() {
echo "classA __construct". PHP_EOL;
}
}
class classB extends classA
{
public function __construct() {
echo "classB __construct". PHP_EOL;
self::__construct();
}
}
$a = new classB();
简单测试:
结果输出:
原因很简单: 调用了自身construct,进入死循环了,应该是parrent::construct();而不是self::construct().
造成栈溢出可能还有其他情况,比如超巨大局部变量,函数无穷递归~