php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #48394 Error handling example incorrect
Submitted: 2009-05-26 03:24 UTC Modified: 2009-05-26 11:38 UTC
From: shangxiao@php.net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2009-05-26 03:24 UTC] shangxiao@php.net
Description:
------------
The example in the manual on error handling "Examples" 
http://www.php.net/manual/en/errorfunc.examples.php shows that all 
errors can be handled in the error handler.

However in the manual page for set_error_handler:

The following error types cannot be handled with a user defined 
function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, 
E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the 
file where set_error_handler() is called.

Reproduce code:
---------------
---
From manual page: errorfunc.examples
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-26 07:17 UTC] bjori@php.net
The comment mentions this:
    // in reality the only entries we should
    // consider are E_WARNING, E_NOTICE, E_USER_ERROR,
    // E_USER_WARNING and E_USER_NOTICE

 [2009-05-26 11:25 UTC] shangxiao@php.net
That's pretty confusing.  The example lists all the error types and then 
a comment states "in reality we would only use some of the types" 
without stating explicitly that it's impossible to use certain types.

In the end it's up to you if you want to make it clearer or not, it's 
neither here nor there for me.
 [2009-05-26 11:38 UTC] bjori@php.net
As a member of php.net you know how things work:
 Suggest a specific change (preferably with patch) if you find things to be unclear.
It is very clear to me so I can't think of a way to improve it without a lot of useless info which are documented in detail elsewhere.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 11:00:02 2026 UTC