mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Tie together ErrorException severity and error constants (doc #63158)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339185 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
83153b3f58
commit
ecf52eec24
2 changed files with 11 additions and 3 deletions
|
@ -13,7 +13,7 @@
|
|||
<modifier>public</modifier> <methodname>ErrorException::__construct</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>message</parameter><initializer>""</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>code</parameter><initializer>0</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>severity</parameter><initializer>1</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>severity</parameter><initializer>E_ERROR</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>filename</parameter><initializer>__FILE__</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>lineno</parameter><initializer>__LINE__</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>Exception</type><parameter>previous</parameter><initializer>&null;</initializer></methodparam>
|
||||
|
@ -49,6 +49,12 @@
|
|||
<para>
|
||||
The severity level of the exception.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
While the severity can be any <type>integer</type> value, it is intended that the
|
||||
<link linkend="errorfunc.constants">error constants</link> be used.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
|
|
|
@ -39,9 +39,10 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
try {
|
||||
throw new ErrorException("Exception message", 0, 75);
|
||||
throw new ErrorException("Exception message", 0, E_USER_ERROR);
|
||||
} catch(ErrorException $e) {
|
||||
echo "This exception severity is: " . $e->getSeverity();
|
||||
var_dump($e->getSeverity() === E_USER_ERROR);
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
@ -49,7 +50,8 @@ try {
|
|||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
This exception severity is: 75
|
||||
This exception severity is: 256
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue