【发布时间】:2016-01-15 15:06:37
【问题描述】:
阅读本站 here 上的文章后,我编写了以下代码:
<?php
try{
annundefinedmethod();
}
catch(RuntimeException $e){
echo 'Runtime exception called';
}
catch(BadFunctionCallException $e){
echo 'Bad function call exception called';
}
catch(Exception $e){
echo 'General exception called';
}
?>
我想根据 try 块中函数调用的正确异常显示错误。但是,上述所有异常都不起作用,我仍然收到一条错误消息,提示 uncaught error : call to undefined method.... 我的代码出了什么问题?
【问题讨论】:
标签: php exception exception-handling