php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76389 Documentation to clarify error_reporting levels
Submitted: 2018-05-29 12:49 UTC Modified: 2018-05-29 13:00 UTC
From: luisdv at icon dot co dot za Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: luisdv at icon dot co dot za
New email:
PHP Version: OS:

 

 [2018-05-29 12:49 UTC] luisdv at icon dot co dot za
Description:
------------
---
From manual page: http://www.php.net/function.error-reporting
---

The above error-reporting article describes these two reporting levels:

// Report all PHP errors (see changelog)
error_reporting(E_ALL);

// Report all PHP errors
error_reporting(-1);

What is the difference between the two? When would you use one instead of the other?

Please update the article with a clear explanation of the differences and an example of the correct use cases for each level.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-29 13:00 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 [2018-05-29 13:00 UTC] peehaa@php.net
The difference is what E_ALL reports on different versions of PHP which is defined in the changelog.

It used to report all errors but strict. Nowadays -1 and E_ALL are the same.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 17:01:23 2020 UTC