-
Notifications
You must be signed in to change notification settings - Fork 788
/
Copy pathphp7.xml
117 lines (109 loc) · 3.65 KB
/
php7.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="language.errors.php7" xmlns="http://docbook.org/ns/docbook">
<title>Errors in PHP 7</title>
<para>
PHP 7 changes how most errors are reported by PHP. Instead of reporting
errors through the traditional error reporting mechanism used by PHP 5, most
errors are now reported by throwing <classname>Error</classname> exceptions.
</para>
<para>
As with normal exceptions, these <classname>Error</classname> exceptions
will bubble up until they reach the first matching
<link linkend="language.exceptions.catch"><literal>catch</literal></link>
block. If there are no matching blocks, then any default exception handler
installed with <function>set_exception_handler</function> will be called,
and if there is no default exception handler, then the exception will be
converted to a fatal error and will be handled like a traditional error.
</para>
<para>
As the <classname>Error</classname> hierarchy does not inherit from
<classname>Exception</classname>, code that uses
<code>catch (Exception $e) { ... }</code> blocks to handle uncaught
exceptions in PHP 5 will find that these <classname>Error</classname>s are
not caught by these blocks. Either a <code>catch (Error $e) { ... }</code>
block or a <function>set_exception_handler</function> handler is required.
</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>
<itemizedlist>
<listitem>
<simpara><classname>DivisionByZeroError</classname></simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara><classname>AssertionError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>CompileError</classname></simpara>
<itemizedlist>
<listitem>
<simpara><classname>ParseError</classname></simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara><classname>TypeError</classname></simpara>
<itemizedlist>
<listitem>
<simpara><classname>ArgumentCountError</classname></simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara><classname>ValueError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>UnhandledMatchError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>FiberError</classname></simpara>
</listitem>
<listitem>
<simpara><classname>RequestParseBodyException</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
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
-->