php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #13934 set_error_handler is ignored for parse errors
Submitted: 2001-11-05 10:35 UTC Modified: 2001-11-05 11:00 UTC
From: lars at ioflux dot net Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS: solaris and linux
Private report: No CVE-ID: None
 [2001-11-05 10:35 UTC] lars at ioflux dot net
The example script below fails to catch parse errors (line 12 is a parse error):

<?php

 error_reporting(E_ALL);
 
 $old_error_handler = set_error_handler("myErrorHandler"); 

 function myErrorHandler($errno, $errstr, $errfile, $errline) 
 {
   echo "Hi, I am an error of type: '$errno' wit message: '$errmsg'<br>\n";
 }

 print;

?>  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-05 11:00 UTC] derick@php.net
You can't catch parse errors (or any other error with error_level E_ERROR).
Not a bug > bogus.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 05:01:31 2024 UTC