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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

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: Sun May 19 04:01:33 2024 UTC