note 109904 modified in errorfunc.constants by danbrown

From: Date: Sun, 02 Sep 2012 17:11:11 +0000
Subject: note 109904 modified in errorfunc.constants by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-190429@lists.php.net to get a copy of this message
this would give you all the reported exception list of your configuration.&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;function FriendlyErrorType($type)&#13;&#10;{ &#13;&#10;&#9;$return =&#34;&#34;;&#13;&#10; if($type &#38; E_ERROR) // 1 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_ERROR &#39;;&#13;&#10;&#9;if($type &#38; E_WARNING) // 2 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_WARNING &#39;;&#13;&#10;&#9;if($type &#38; E_PARSE) // 4 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_PARSE &#39;;&#13;&#10;&#9;if($type &#38; E_NOTICE) // 8 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_NOTICE &#39;;&#13;&#10;&#9;if($type &#38; E_CORE_ERROR) // 16 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_CORE_ERROR &#39;;&#13;&#10;&#9;if($type &#38; E_CORE_WARNING) // 32 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_CORE_WARNING &#39;;&#13;&#10;&#9;if($type &#38; E_CORE_ERROR) // 64 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_COMPILE_ERROR &#39;;&#13;&#10;&#9;if($type &#38; E_CORE_WARNING) // 128 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_COMPILE_WARNING &#39;;&#13;&#10;&#9;if($type &#38; E_USER_ERROR) // 256 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_USER_ERROR &#39;;&#13;&#10;&#9;if($type &#38; E_USER_WARNING) // 512 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_USER_WARNING &#39;;&#13;&#10;&#9;if($type &#38; E_USER_NOTICE) // 1024 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_USER_NOTICE &#39;;&#13;&#10;&#9;if($type &#38; E_STRICT) // 2048 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_STRICT &#39;;&#13;&#10;&#9;if($type &#38; E_RECOVERABLE_ERROR) // 4096 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_RECOVERABLE_ERROR &#39;;&#13;&#10;&#9;if($type &#38; E_DEPRECATED) // 8192 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_DEPRECATED &#39;;&#13;&#10;&#9;if($type &#38; E_USER_DEPRECATED) // 16384 //&#13;&#10;&#9;&#9;$return.=&#39;&#38; E_USER_DEPRECATED &#39;;&#13;&#10; return substr($return,2);&#13;&#10;} &#13;&#10;echo &#34;error_reporting = &#34; . FriendlyErrorType(ini_get(&#39;error_reporting&#39;)) .&#34;;&#60;br&#62;&#34;;&#13;&#10;?&#62; --was-- this would give you all the reported exception list of your configuration. ` function FriendlyErrorType($type) { $return =""; if($type & E_ERROR) // 1 // $return.='& E_ERROR '; if($type & E_WARNING) // 2 // $return.='& E_WARNING '; if($type & E_PARSE) // 4 // $return.='& E_PARSE '; if($type & E_NOTICE) // 8 // $return.='& E_NOTICE '; if($type & E_CORE_ERROR) // 16 // $return.='& E_CORE_ERROR '; if($type & E_CORE_WARNING) // 32 // $return.='& E_CORE_WARNING '; if($type & E_CORE_ERROR) // 64 // $return.='& E_COMPILE_ERROR '; if($type & E_CORE_WARNING) // 128 // $return.='& E_COMPILE_WARNING '; if($type & E_USER_ERROR) // 256 // $return.='& E_USER_ERROR '; if($type & E_USER_WARNING) // 512 // $return.='& E_USER_WARNING '; if($type & E_USER_NOTICE) // 1024 // $return.='& E_USER_NOTICE '; if($type & E_STRICT) // 2048 // $return.='& E_STRICT '; if($type & E_RECOVERABLE_ERROR) // 4096 // $return.='& E_RECOVERABLE_ERROR '; if($type & E_DEPRECATED) // 8192 // $return.='& E_DEPRECATED '; if($type & E_USER_DEPRECATED) // 16384 // $return.='& E_USER_DEPRECATED '; return substr($return,2); } echo "error_reporting = " . FriendlyErrorType(ini_get('error_reporting')) .";<br>"; ` http://php.net/manual/en/errorfunc.constants.php

« previous php.notes (#190429) next »