array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'class.throwable.php', 1 => 'Throwable', ), 'up' => array ( 0 => 'reserved.interfaces.php', 1 => '预定义接口和类', ), 'prev' => array ( 0 => 'internaliterator.valid.php', 1 => 'InternalIterator::valid', ), 'next' => array ( 0 => 'throwable.getmessage.php', 1 => 'Throwable::getMessage', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'language/predefined/throwable.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.throwable.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7, PHP 8)
Throwable 是能被 throw
语句抛出的最基本的接口(interface),包含了
Error 和 Exception 。
注意:
PHP 类无法直接实现 (implement) Throwable 接口,而应当去继承 Exception。
版本 | 说明 |
---|---|
8.0.0 | 现在 Throwable 实现了 Stringable。 |