Add Error documentation.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337354 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Harvey 2015-08-09 01:16:05 +00:00
parent 4eefb1e936
commit 9a4e00c8f0
11 changed files with 503 additions and 6 deletions

View file

@ -29,10 +29,45 @@
block or a <function>set_exception_handler</function> handler is required.
</para>
<para>
A list of <classname>Error</classname> subclasses can be found in the
<link linkend="book.errorfunc">error function section</link> of the manual.
</para>
<sect2 xml:id="language.errors.php7.hierarchy">
<title><classname>Error</classname> hierarchy</title>
<itemizedlist>
<listitem>
<simpara><classname>Throwable</classname></simpara>
<itemizedlist>
<listitem>
<simpara><classname>Error</classname></simpara>
<itemizedlist>
<listitem>
<simpara><classname>ArithmeticError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>AssertionError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>DivisionByZeroError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>ParseError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>TypeError</classname></simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara><classname>Exception</classname></simpara>
<itemizedlist>
<listitem>
<simpara>...</simpara>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:exceptionref xml:id="class.arithmeticerror"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:phpdoc="http://php.net/ns/phpdoc">
<title>ArithmeticError</title>
<titleabbrev>ArithmeticError</titleabbrev>
<partintro>
<!-- {{{ Error intro -->
<section xml:id="arithmeticerror.intro">
&reftitle.intro;
<para>
<ooclass><classname>ArithmeticError</classname></ooclass> is thrown when
an error occurs while performing mathematical operations. In PHP 7.0,
these errors include attempting to perform a bitshift by a negative
amount, and any call to <function>intdiv</function> that would result in a
value outside the possible bounds of an <type>integer</type>.
</para>
</section>
<!-- }}} -->
<section xml:id="arithmeticerror.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>ArithmeticError</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>ArithmeticError</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>Error</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.throwable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
</phpdoc:exceptionref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:exceptionref xml:id="class.assertionerror"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:phpdoc="http://php.net/ns/phpdoc">
<title>AssertionError</title>
<titleabbrev>AssertionError</titleabbrev>
<partintro>
<!-- {{{ Error intro -->
<section xml:id="assertionerror.intro">
&reftitle.intro;
<para>
<ooclass><classname>AssertionError</classname></ooclass> is thrown when
an assertion made via <function>assert</function> fails.
</para>
</section>
<!-- }}} -->
<section xml:id="assertionerror.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>AssertionError</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>AssertionError</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>Error</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.throwable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
</phpdoc:exceptionref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:exceptionref xml:id="class.divisionbyzeroerror"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:phpdoc="http://php.net/ns/phpdoc">
<title>DivisionByZeroError</title>
<titleabbrev>DivisionByZeroError</titleabbrev>
<partintro>
<!-- {{{ Error intro -->
<section xml:id="divisionbyzeroerror.intro">
&reftitle.intro;
<para>
<ooclass><classname>DivisionByZeroError</classname></ooclass> is thrown
when an attempt is made to divide a number by zero.
</para>
</section>
<!-- }}} -->
<section xml:id="divisionbyzeroerror.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>DivisionByZeroError</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>DivisionByZeroError</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>Error</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.throwable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
</phpdoc:exceptionref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:exceptionref xml:id="class.error"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:phpdoc="http://php.net/ns/phpdoc">
<title>Error</title>
<titleabbrev>Error</titleabbrev>
<partintro>
<!-- {{{ Error intro -->
<section xml:id="error.intro">
&reftitle.intro;
<para>
<ooclass><classname>Error</classname></ooclass> is the base class for all
internal PHP error exceptions.
</para>
</section>
<!-- }}} -->
<section xml:id="error.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>Error</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>Error</classname>
</ooclass>
<ooclass>
<modifier>implements</modifier>
<classname>Throwable</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.throwable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
</phpdoc:exceptionref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -16,7 +16,12 @@
&reftitle.intro;
<para>
<ooclass><classname>Exception</classname></ooclass> is the base class for
all Exceptions.
all Exceptions in PHP 5, and the base class for all user exceptions in PHP
7.
</para>
<para>
In PHP 7, <classname>Exception</classname> implements the
<classname>Throwable</classname> interface.
</para>
</section>
<!-- }}} -->

View file

@ -13,6 +13,14 @@
&language.predefined.exception;
&language.predefined.errorexception;
<!-- If this is updated, you should also update the hierarchy in
language/errors/php7.xml. -->
&language.predefined.error;
&language.predefined.arithmeticerror;
&language.predefined.assertionerror;
&language.predefined.divisionbyzeroerror;
&language.predefined.parseerror;
&language.predefined.typeerror;
</part>
<!-- Keep this comment at the end of the file

View file

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:exceptionref xml:id="class.parseerror"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:phpdoc="http://php.net/ns/phpdoc">
<title>ParseError</title>
<titleabbrev>ParseError</titleabbrev>
<partintro>
<!-- {{{ Error intro -->
<section xml:id="parseerror.intro">
&reftitle.intro;
<para>
<ooclass><classname>ParseError</classname></ooclass> is thrown when an
error occurs while parsing PHP code, such as when
<function>eval</function> is called.
</para>
</section>
<!-- }}} -->
<section xml:id="parseerror.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>ParseError</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>ParseError</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>Error</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.throwable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
</phpdoc:exceptionref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -13,7 +13,7 @@
&reftitle.intro;
<para>
<classname>Throwable</classname> is the base interface for any object that
can be thrown via a &throw; statement, including
can be thrown via a &throw; statement in PHP 7, including
<classname>Error</classname> and <classname>Exception</classname>.
</para>
<note>

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:exceptionref xml:id="class.typeerror"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:phpdoc="http://php.net/ns/phpdoc">
<title>TypeError</title>
<titleabbrev>TypeError</titleabbrev>
<partintro>
<!-- {{{ Error intro -->
<section xml:id="typeerror.intro">
&reftitle.intro;
<para>
<ooclass><classname>TypeError</classname></ooclass> is thrown when strict
typing is enabled and an invalid argument is given to a function.
</para>
</section>
<!-- }}} -->
<section xml:id="typeerror.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>TypeError</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>TypeError</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>Error</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.throwable')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
</phpdoc:exceptionref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -7,6 +7,13 @@
<versions>
<function name='__autoload' from='PHP 5' />
<function name='error' from='PHP 7' />
<function name='arithmeticerror' from='PHP 7' />
<function name='assertionerror' from='PHP 7' />
<function name='divisionbyzeroerror' from='PHP 7' />
<function name='parseerror' from='PHP 7' />
<function name='typeerror' from='PHP 7' />
<function name='exception' from='PHP 5 &gt;= 5.1.0'/>
<function name='exception::__clone' from='PHP 5 &gt;= 5.1.0'/>
<function name='exception::__construct' from='PHP 5 &gt;= 5.1.0'/>