Her*_*ntz 4 php class object exit
是否有可能做到这一点?
$objetc -> runAndFinish();
echo "this should not be echoed";
Run Code Online (Sandbox Code Playgroud)
而不是这个?
$objetc -> runAndFinish();
exit();
echo "this should not be echoed";
Run Code Online (Sandbox Code Playgroud)
所以runAndFinish(); 方法会以某种方式结束脚本处理.可能吗?
Geo*_*ner 10
放一个出口(); 在你的类里面runAndFinish(); 方法
class someClass{
function runAndFinish(){
exit();
}
}
$obj = new someClass();
$obj->runAndFinish();
echo "not gonna print";
Run Code Online (Sandbox Code Playgroud)