note 109012 deleted from errorfunc.constants by danbrown
| From: | danbrown@php.net | Date: | Wed, 13 Jun 2012 15:22:52 +0000 |
| Subject: | note 109012 deleted from errorfunc.constants by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188564@lists.php.net to get a copy of this message | ||
Note Submitter: ThoRas
----
I think, my solution is simplier than vladvarna's:
private function GetErrorName($type) {
$errortypes = array(
E_ERROR => 'E_ERROR',
E_WARNING => 'E_WARNING',
E_PARSE => 'E_PARSE',
E_NOTICE => 'E_NOTICE',
E_CORE_ERROR => 'E_CORE_ERROR',
E_CORE_WARNING => 'E_CORE_WARNING',
E_CORE_ERROR => 'E_COMPILE_ERROR',
E_CORE_WARNING => 'E_COMPILE_WARNING',
E_USER_ERROR => 'E_USER_ERROR',
E_USER_WARNING => 'E_USER_WARNING',
E_USER_NOTICE => 'E_USER_NOTICE',
E_STRICT => 'E_STRICT',
E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
E_DEPRECATED => 'E_DEPRECATED',
E_USER_DEPRECATED => 'E_USER_DEPRECATED',
E_ALL => 'E_ALL'
);
if (isset($errortypes[$type])) return $errortypes[$type];
return 'E_UNKNOWN';
}