This is a discussion on Notice errors with set_error_handler within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Questions in comments. Thanks you. Greetings, - John <? error_reporting (E_ALL); function myErrorHandler($errno, $errstr, $errfile, $errline) { echo "<br&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Questions in comments.
Thanks you. Greetings, - John <? error_reporting (E_ALL); function myErrorHandler($errno, $errstr, $errfile, $errline) { echo "<br>Error number $errno \"$errstr\" in $errfile on line $errline.<br>"; } $x = $a; @$x = $b; set_error_handler("myErrorHandler"); $x = $c; @$x = $d; /* Displays: Notice: Undefined variable: a in c:\data\htdocs\projects\photobook\testerror.php on line 8 Error number 8 "Undefined variable: c" in c:\data\htdocs\projects\photobook\testerror.php on line 11. Error number 8 "Undefined variable: d" in c:\data\htdocs\projects\photobook\testerror.php on line 12. 1) Why does it fall over @$x = $d (with my own error handler) and not over @$x = $b with the standard error handler? 2) From the manual I understood only E_USER_* errors were handled by the set_error_handler. Why is E_NOTICE given to myErrorHandler()? */ ?> |
|
|||
|
"Janwillem Borleffs" <jwb@jwbfoto.demon.nl> schreef in bericht news:3f2046d9$0$28907$1b62eedf@news.euronet.nl... > > It actually falls over the lines > $x = $a; > @$x = $b; > Correction, it falls over the first line only. The error message is surpressed in the second line with the @-sign. JW |
![]() |
| Thread Tools | |
| Display Modes | |
|
|