note 119792 added to errorfunc.constants

From: Date: Fri, 26 Aug 2016 15:47:04 +0000
Subject: note 119792 added to errorfunc.constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-206399@lists.php.net to get a copy of this message
Notes posted above limited to current errors level as on 26th Aug 2016, following snippet will work even on introduction of new error level $errLvl = error_reporting(); for ( $i = 1; $i < E_ALL; $i*=2 ) { print FriendlyErrorType($errLvl & $i) . "<br>\n"; } function FriendlyErrorType($type) { switch($type) { case E_ERROR: // 1 // return 'E_ERROR'; case E_WARNING: // 2 // return 'E_WARNING'; case E_PARSE: // 4 // return 'E_PARSE'; case E_NOTICE: // 8 // return 'E_NOTICE'; case E_CORE_ERROR: // 16 // return 'E_CORE_ERROR'; case E_CORE_WARNING: // 32 // return 'E_CORE_WARNING'; case E_COMPILE_ERROR: // 64 // return 'E_COMPILE_ERROR'; case E_COMPILE_WARNING: // 128 // return 'E_COMPILE_WARNING'; case E_USER_ERROR: // 256 // return 'E_USER_ERROR'; case E_USER_WARNING: // 512 // return 'E_USER_WARNING'; case E_USER_NOTICE: // 1024 // return 'E_USER_NOTICE'; case E_STRICT: // 2048 // return 'E_STRICT'; case E_RECOVERABLE_ERROR: // 4096 // return 'E_RECOVERABLE_ERROR'; case E_DEPRECATED: // 8192 // return 'E_DEPRECATED'; case E_USER_DEPRECATED: // 16384 // return 'E_USER_DEPRECATED'; } return ""; } ---- Server IP: 83.137.20.135 Probable Submitter: 103.24.99.82 ---- Manual Page -- http://php.net/manual/en/errorfunc.constants.php Edit -- https://master.php.net/note/edit/119792 Del: integrated -- https://master.php.net/note/delete/119792/integrated Del: useless -- https://master.php.net/note/delete/119792/useless Del: bad code -- https://master.php.net/note/delete/119792/bad+code Del: spam -- https://master.php.net/note/delete/119792/spam Del: non-english -- https://master.php.net/note/delete/119792/non-english Del: in docs -- https://master.php.net/note/delete/119792/in+docs Del: other reasons-- https://master.php.net/note/delete/119792 Reject -- https://master.php.net/note/reject/119792 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206399) next »