本文主要是介绍PHP7 用 Exception catch不到error,Throwable 才可以,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Throwable work on PHP 7.x.
Exception work on PHP 5.x.
参考链接: https://www.php.net/manual/en/language.errors.php7.php
<?phptry {// Code that may throw an Exception or Error.} catch (Throwable $t) {// Executed only in PHP 7, will not match in PHP 5} catch (Exception $e) {// Executed only in PHP 5, will not be reached in PHP 7}
这篇关于PHP7 用 Exception catch不到error,Throwable 才可以的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!