Add error handling to the backward incompatible changes.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337358 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Harvey 2015-08-09 01:16:24 +00:00
parent f2f7f3fa1d
commit 98811e1fcb
2 changed files with 63 additions and 0 deletions

View file

@ -4,6 +4,7 @@
<sect1 xml:id="migration70.incompatible">
<title>Backward incompatible changes</title>
&appendices.migration70.incompatible.error-handling;
&appendices.migration70.incompatible.variable-handling;
&appendices.migration70.incompatible.foreach;
&appendices.migration70.incompatible.integers;

View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect2 xml:id="migration70.incompatible.error-handling">
<title>Changes to error and exception handling</title>
<para>
Many fatal and recoverable fatal errors have been converted to exceptions in
PHP 7. These error exceptions inherit from the <classname>Error</classname>
class, which itself implements the <classname>Throwable</classname>
interface, which is now the base interface all exceptions inherit.
</para>
<para>
A fuller description of how errors operate in PHP 7 can be found
<link linkend="language.errors.php7">on the PHP 7 errors page</link>. This
migration guide will merely enumerate the changes that affect backward
compatibility.
</para>
<sect3 xml:id="migration70.incompatible.error-handling.constructors">
<title>Internal constructors always throw exceptions on failure</title>
<para>
Previously, some internal classes would return &null; or an unusable object
when the constructor failed. All internal classes will now throw an
<classname>Exception</classname> in this case in the same way that user
classes already had to.
</para>
</sect3>
<sect3 xml:id="migration70.incompatible.error-handling.parse">
<title>Parse errors throw <classname>ParseError</classname></title>
<para>
Parser errors now throw a <classname>ParseError</classname> object. Error
handling for <function>eval</function> should now include a &catch; block
that can handle this error.
</para>
</sect3>
</sect2>
<!-- 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
-->