svn: /phpdoc/en/trunk/appendices/migration70/ incompatible/error-handling.xml incompatible.xml
| From: | Adam Harvey | Date: | Sun, 09 Aug 2015 01:16:24 +0000 |
| Subject: | svn: /phpdoc/en/trunk/appendices/migration70/ incompatible/error-handling.xml incompatible.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13541@lists.php.net to get a copy of this message | ||
aharvey Sun, 09 Aug 2015 01:16:24 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337358
Log:
Add error handling to the backward incompatible changes.
Changed paths:
A phpdoc/en/trunk/appendices/migration70/incompatible/error-handling.xml
U phpdoc/en/trunk/appendices/migration70/incompatible.xml
Added: phpdoc/en/trunk/appendices/migration70/incompatible/error-handling.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration70/incompatible/error-handling.xml
(rev 0)
+++ phpdoc/en/trunk/appendices/migration70/incompatible/error-handling.xml 2015-08-09 01:16:24 UTC
(rev 337358)
@@ -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
+-->
Modified: phpdoc/en/trunk/appendices/migration70/incompatible.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration70/incompatible.xml 2015-08-09 01:16:19 UTC (rev 337357)
+++ phpdoc/en/trunk/appendices/migration70/incompatible.xml 2015-08-09 01:16:24 UTC (rev 337358)
@@ -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;