svn: /phpdoc/en/trunk/language/predefined/errorexception/ construct.xml getseverity.xml

From: Date: Thu, 19 May 2016 20:47:23 +0000
Subject: svn: /phpdoc/en/trunk/language/predefined/errorexception/ construct.xml getseverity.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-14138@lists.php.net to get a copy of this message
salathe Thu, 19 May 2016 20:47:23 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=339185 Log: Tie together ErrorException severity and error constants (doc #63158) Bug: https://bugs.php.net/63158 (Assigned) Misleading Example of ErrorException::getSeverity() Changed paths: U phpdoc/en/trunk/language/predefined/errorexception/construct.xml U phpdoc/en/trunk/language/predefined/errorexception/getseverity.xml Modified: phpdoc/en/trunk/language/predefined/errorexception/construct.xml =================================================================== --- phpdoc/en/trunk/language/predefined/errorexception/construct.xml 2016-05-19 14:10:00 UTC (rev 339184) +++ phpdoc/en/trunk/language/predefined/errorexception/construct.xml 2016-05-19 20:47:23 UTC (rev 339185) @@ -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> Modified: phpdoc/en/trunk/language/predefined/errorexception/getseverity.xml =================================================================== --- phpdoc/en/trunk/language/predefined/errorexception/getseverity.xml 2016-05-19 14:10:00 UTC (rev 339184) +++ phpdoc/en/trunk/language/predefined/errorexception/getseverity.xml 2016-05-19 20:47:23 UTC (rev 339185) @@ -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 @@ &example.outputs.similar; <screen> <![CDATA[ -This exception severity is: 75 +This exception severity is: 256 +bool(true) ]]> </screen> </example>

« previous php.doc.cvs (#14138) next »