From 78dd7380aadf17fd0c1db781d0a741c7334c11a2 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Tue, 2 Mar 2004 15:22:06 +0000 Subject: [PATCH] fix for #27459 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@152779 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/errorfunc/constants.xml | 18 ++++++++--------- reference/errorfunc/examples.xml | 33 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/reference/errorfunc/constants.xml b/reference/errorfunc/constants.xml index 05fd1f9cfd..6c91f36b0d 100644 --- a/reference/errorfunc/constants.xml +++ b/reference/errorfunc/constants.xml @@ -1,5 +1,5 @@ - +
&reftitle.constants; &extension.constants.core; @@ -86,7 +86,7 @@ Fatal errors that occur during PHP's initial startup. This is like an E_ERROR, except it is generated by the core of PHP. - PHP 4 only + since PHP 4 @@ -100,7 +100,7 @@ This is like an E_WARNING, except it is generated by the core of PHP. - PHP 4 only + since PHP 4 @@ -113,7 +113,7 @@ Fatal compile-time errors. This is like an E_ERROR, except it is generated by the Zend Scripting Engine. - PHP 4 only + since PHP 4 @@ -127,7 +127,7 @@ E_WARNING, except it is generated by the Zend Scripting Engine. - PHP 4 only + since PHP 4 @@ -141,7 +141,7 @@ E_ERROR, except it is generated in PHP code by using the PHP function trigger_error. - PHP 4 only + since PHP 4 @@ -155,7 +155,7 @@ E_WARNING, except it is generated in PHP code by using the PHP function trigger_error. - PHP 4 only + since PHP 4 @@ -169,7 +169,7 @@ E_NOTICE, except it is generated in PHP code by using the PHP function trigger_error. - PHP 4 only + since PHP 4 @@ -197,7 +197,7 @@ to your code which will ensure the best interoperability and forward compatibility of your code. - PHP 5 only + since PHP 5 diff --git a/reference/errorfunc/examples.xml b/reference/errorfunc/examples.xml index df87e89188..d9bd5c3b90 100644 --- a/reference/errorfunc/examples.xml +++ b/reference/errorfunc/examples.xml @@ -1,5 +1,5 @@ - +
&reftitle.examples; @@ -23,19 +23,21 @@ function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) // define an assoc array of error string // in reality the only entries we should - // consider are 2,8,256,512 and 1024 + // consider are E_WARNING, E_NOTICE, E_USER_ERROR, + // E_USER_WARNING and E_USER_NOTICE $errortype = array ( - 1 => "Error", - 2 => "Warning", - 4 => "Parsing Error", - 8 => "Notice", - 16 => "Core Error", - 32 => "Core Warning", - 64 => "Compile Error", - 128 => "Compile Warning", - 256 => "User Error", - 512 => "User Warning", - 1024 => "User Notice" + E_ERROR => "Error", + E_WARNING => "Warning", + E_PARSE => "Parsing Error", + E_NOTICE => "Notice", + E_CORE_ERROR => "Core Error", + E_CORE_WARNING => "Core Warning", + E_COMPILE_ERROR => "Compile Error", + E_COMPILE_WARNING => "Compile Warning", + E_USER_ERROR => "User Error", + E_USER_WARNING => "User Warning", + E_USER_NOTICE => "User Notice", + E_STRICT => "Runtime Notice" ); // set of errors for which a var trace will be saved $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE); @@ -57,8 +59,9 @@ function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) // save to the error log, and e-mail me if there is a critical user error error_log($err, 3, "/usr/local/php4/error.log"); - if ($errno == E_USER_ERROR) + if ($errno == E_USER_ERROR) { mail("phpdev@example.com", "Critical User Error", $err); + } } @@ -100,7 +103,7 @@ $t = I_AM_NOT_DEFINED; // define some "vectors" $a = array(2, 3, "foo"); $b = array(5.5, 4.3, -1.6); -$c = array (1, -3); +$c = array(1, -3); // generate a user error $t1 = distance($c, $b) . "\n";