<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Throwable</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="iteratoraggregate.getiterator.html">IteratorAggregate::getIterator</a></div> <div class="next" style="text-align: right; float: right;"><a href="throwable.getmessage.html">Throwable::getMessage</a></div> <div class="up"><a href="reserved.interfaces.html">Predefined Interfaces and Classes</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.throwable" class="reference"> <h1 class="title">Throwable</h1> <div class="partintro"><p class="verinfo">(PHP 7)</p> <div class="section" id="throwable.intro"> <h2 class="title">Introduction</h2> <p class="para"> <strong class="classname">Throwable</strong> is the base interface for any object that can be thrown via a <a href="language.exceptions.html" class="link"><em>throw</em></a> statement in PHP 7, including <a href="class.error.html" class="classname">Error</a> and <a href="class.exception.html" class="classname">Exception</a>. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> PHP classes cannot implement the <strong class="classname">Throwable</strong> interface directly, and must instead extend <a href="class.exception.html" class="classname">Exception</a>. </p> </p></blockquote> </div> <div class="section" id="throwable.synopsis"> <h2 class="title">Interface synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"> <strong class="classname">Throwable</strong> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="throwable.getmessage.html" class="methodname">getMessage</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><a href="throwable.getcode.html" class="methodname">getCode</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="throwable.getfile.html" class="methodname">getFile</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><a href="throwable.getline.html" class="methodname">getLine</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><a href="throwable.gettrace.html" class="methodname">getTrace</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="throwable.gettraceasstring.html" class="methodname">getTraceAsString</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">Throwable</span> <span class="methodname"><a href="throwable.getprevious.html" class="methodname">getPrevious</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="throwable.tostring.html" class="methodname">__toString</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="throwable.getmessage.html">Throwable::getMessage</a> — Gets the message</li><li><a href="throwable.getcode.html">Throwable::getCode</a> — Gets the exception code</li><li><a href="throwable.getfile.html">Throwable::getFile</a> — Gets the file in which the exception was created</li><li><a href="throwable.getline.html">Throwable::getLine</a> — Gets the line on which the object was instantiated</li><li><a href="throwable.gettrace.html">Throwable::getTrace</a> — Gets the stack trace</li><li><a href="throwable.gettraceasstring.html">Throwable::getTraceAsString</a> — Gets the stack trace as a string</li><li><a href="throwable.getprevious.html">Throwable::getPrevious</a> — Returns the previous Throwable</li><li><a href="throwable.tostring.html">Throwable::__toString</a> — Gets a string representation of the thrown object</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="iteratoraggregate.getiterator.html">IteratorAggregate::getIterator</a></div> <div class="next" style="text-align: right; float: right;"><a href="throwable.getmessage.html">Throwable::getMessage</a></div> <div class="up"><a href="reserved.interfaces.html">Predefined Interfaces and Classes</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>