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
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: 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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC