note 119469 added to errorfunc.constants
| From: | Anonymous | Date: | Wed, 15 Jun 2016 07:38:37 +0000 |
| Subject: | note 119469 added to errorfunc.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205725@lists.php.net to get a copy of this message | ||
My version!
For long list function returns for example "E_ALL without E_DEPRECATED "
function errorLevel()
{
$levels = array(
'E_ERROR',
'E_WARNING',
'E_PARSE',
'E_NOTICE',
'E_CORE_ERROR',
'E_CORE_WARNING',
'E_COMPILE_ERROR',
'E_COMPILE_WARNING',
'E_USER_ERROR',
'E_USER_WARNING',
'E_USER_NOTICE',
'E_STRICT',
'E_RECOVERABLE_ERROR',
'E_DEPRECATED',
'E_USER_DEPRECATED',
'E_ALL'
);
$excluded = $included = array();
$errLvl = error_reporting();
foreach ($levels as $lvl) {
$val = constant($lvl);
if ($errLvl & $val) {
$included []= $lvl;
} else {
$excluded []= $lvl;
}
}
if (count($excluded) > count($included)) {
echo '<br />Consist: '.implode(',', $included);
} else {
echo '<br />Consist: E_ALL without '.implode(',', $excluded);
}
}
----
Server IP: 72.52.91.14
Probable Submitter: 62.165.23.197
----
Manual Page -- http://php.net/manual/en/errorfunc.constants.php
Edit -- https://master.php.net/note/edit/119469
Del: integrated -- https://master.php.net/note/delete/119469/integrated
Del: useless -- https://master.php.net/note/delete/119469/useless
Del: bad code -- https://master.php.net/note/delete/119469/bad+code
Del: spam -- https://master.php.net/note/delete/119469/spam
Del: non-english -- https://master.php.net/note/delete/119469/non-english
Del: in docs -- https://master.php.net/note/delete/119469/in+docs
Del: other reasons-- https://master.php.net/note/delete/119469
Reject -- https://master.php.net/note/reject/119469
Search -- https://master.php.net/manage/user-notes.php