note 89339 deleted from errorfunc.constants by danbrown
| From: | danbrown@php.net | Date: | Wed, 04 Mar 2009 16:33:52 +0000 |
| Subject: | note 89339 deleted from errorfunc.constants by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151469@lists.php.net to get a copy of this message | ||
Note Submitter: gmblar+php at gmail dot com
----
Never(!) use eval() in any scripts!
This is a better Version of the Script from Kenneth Kin Lum without eval()
<?php
$arrayErrorLevelName = 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'
);
echo "<pre>On PHP " . phpversion() . "\nE_ALL
includes\n--------------\n";;
foreach ($arrayErrorLevelName as $errorLevelName) {
if (defined($errorLevelName) and constant($errorLevelName) & E_ALL)
echo("$errorLevelName\n");
}
?>