<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.interfaces.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'class.throwable.php',
    1 => 'Throwable',
    2 => 'Throwable',
  ),
  'up' => 
  array (
    0 => 'reserved.interfaces.php',
    1 => 'Predefined Interfaces and Classes',
  ),
  'prev' => 
  array (
    0 => 'internaliterator.valid.php',
    1 => 'InternalIterator::valid',
  ),
  'next' => 
  array (
    0 => 'throwable.getmessage.php',
    1 => 'Throwable::getMessage',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/throwable.xml',
  ),
  'history' => 
  array (
  ),
  '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);

contributors($setup);

?>
<div id="class.throwable" class="reference">

 <h1 class="title">Throwable</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 7, PHP 8)</p>


  <div class="section" id="throwable.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    <span class="classname"><strong class="classname">Throwable</strong></span> is the base interface for any object that
    can be thrown via a <a href="language.exceptions.php" class="link"><code class="literal">throw</code></a> statement, including
    <span class="classname"><a href="class.error.php" class="classname">Error</a></span> and <span class="classname"><a href="class.exception.php" class="classname">Exception</a></span>.
   </p>
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <p class="para">
     PHP classes cannot implement the <span class="classname"><strong class="classname">Throwable</strong></span>
     interface directly, and must instead extend
     <span class="classname"><a href="class.exception.php" class="classname">Exception</a></span>.
    </p>
   </p></blockquote>
  </div>


  <div class="section" id="throwable.synopsis">
   <h2 class="title">Interface synopsis</h2>


   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="modifier">interface</span> <strong class="interfacename"><strong class="interfacename">Throwable</strong></strong>

    <span class="modifier">extends</span>
      <a href="class.stringable.php" class="interfacename">Stringable</a> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="throwable.getmessage.php" class="methodname">getMessage</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.getcode.php" class="methodname">getCode</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.getfile.php" class="methodname">getFile</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.getline.php" class="methodname">getLine</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.gettrace.php" class="methodname">getTrace</a></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.gettraceasstring.php" class="methodname">getTraceAsString</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.getprevious.php" class="methodname">getPrevious</a></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.throwable.php" class="type Throwable">Throwable</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="throwable.tostring.php" class="methodname">__toString</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="stringable.tostring.php" class="methodname">Stringable::__toString</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

   }</div>


  </div>

  <div class="section">
   <h2 class="title">Changelog</h2>
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        <span class="classname"><strong class="classname">Throwable</strong></span> implements
        <span class="interfacename"><a href="class.stringable.php" class="interfacename">Stringable</a></span> now.
       </td>
      </tr>

     </tbody>
    
   </table>

  </div>

 </div>

 




 




 




 




 




 




 




 






<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="throwable.getmessage.php">Throwable::getMessage</a> — Gets the message</li><li><a href="throwable.getcode.php">Throwable::getCode</a> — Gets the exception code</li><li><a href="throwable.getfile.php">Throwable::getFile</a> — Gets the file in which the object was created</li><li><a href="throwable.getline.php">Throwable::getLine</a> — Gets the line on which the object was instantiated</li><li><a href="throwable.gettrace.php">Throwable::getTrace</a> — Gets the stack trace</li><li><a href="throwable.gettraceasstring.php">Throwable::getTraceAsString</a> — Gets the stack trace as a string</li><li><a href="throwable.getprevious.php">Throwable::getPrevious</a> — Returns the previous Throwable</li><li><a href="throwable.tostring.php">Throwable::__toString</a> — Gets a string representation of the thrown object</li></ul>
</div>
<?php manual_footer($setup); ?>