mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
fix for #27459
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@152779 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
1ebb68143c
commit
78dd7380aa
2 changed files with 27 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<section id="errorfunc.constants">
|
||||
&reftitle.constants;
|
||||
&extension.constants.core;
|
||||
|
@ -86,7 +86,7 @@
|
|||
Fatal errors that occur during PHP's initial startup. This is like an
|
||||
<constant>E_ERROR</constant>, except it is generated by the core of PHP.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-core-warning">
|
||||
|
@ -100,7 +100,7 @@
|
|||
This is like an <constant>E_WARNING</constant>, except it is generated
|
||||
by the core of PHP.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-compile-error">
|
||||
|
@ -113,7 +113,7 @@
|
|||
Fatal compile-time errors. This is like an <constant>E_ERROR</constant>,
|
||||
except it is generated by the Zend Scripting Engine.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-compile-warning">
|
||||
|
@ -127,7 +127,7 @@
|
|||
<constant>E_WARNING</constant>, except it is generated by the Zend
|
||||
Scripting Engine.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-user-error">
|
||||
|
@ -141,7 +141,7 @@
|
|||
<constant>E_ERROR</constant>, except it is generated in PHP code by
|
||||
using the PHP function <function>trigger_error</function>.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-user-warning">
|
||||
|
@ -155,7 +155,7 @@
|
|||
<constant>E_WARNING</constant>, except it is generated in PHP code by
|
||||
using the PHP function <function>trigger_error</function>.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-user-notice">
|
||||
|
@ -169,7 +169,7 @@
|
|||
<constant>E_NOTICE</constant>, except it is generated in PHP code by
|
||||
using the PHP function <function>trigger_error</function>.
|
||||
</entry>
|
||||
<entry>PHP 4 only</entry>
|
||||
<entry>since PHP 4</entry>
|
||||
</row>
|
||||
|
||||
<row id="e-all">
|
||||
|
@ -197,7 +197,7 @@
|
|||
to your code which will ensure the best interoperability
|
||||
and forward compatibility of your code.
|
||||
</entry>
|
||||
<entry>PHP 5 only</entry>
|
||||
<entry>since PHP 5</entry>
|
||||
</row>
|
||||
|
||||
</tbody>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<section id="errorfunc.examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue