Laravel中的Exception与Throwable各自负责什么样的任务

下面的是框架的源码
https://img4.mukewang.com/5c8f58d100015f5206680649.jpg

我想知道源代码中为什么多了一个Throwable?平时写代码都是用Exception的。还请各路大神指教!

慕桂英3389331
浏览 650回答 2
2回答

人到中年有点甜

Throwable = Exception + Error

素胚勾勒不出你

Throwable 是 php7 新增的顶级异常 interface,包含了 Error 和 Exception。 Throwable is the base interface for any object that can be thrown viaa throw statement in PHP 7, including Error and Exception.PHP classes cannot implement the Throwable interface directly, andmust instead extend Exception.
打开App,查看更多内容
随时随地看视频慕课网APP