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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lars at ioflux dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 14:01:36 2025 UTC