Throwable::getPrevious

(PHP 7, PHP 8)

Throwable::getPrevious返回先前的 Throwable

說明

public Throwable::getPrevious(): ?Throwable

返回任意一個先前的錯誤 (例如, Exception::__construct()中提供的第三個參數)。

參數

此函數沒有參數。

返回值

如果有的話,返回先前的 Throwable,否則就返回 null 。

參見