php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49872 Default for error_reporting() level not documented
Submitted: 2009-10-14 09:14 UTC Modified: 2009-12-11 04:49 UTC
From: chealer at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Debian
Private report: No CVE-ID: None
 [2009-10-14 09:14 UTC] chealer at gmail dot com
Description:
------------
error_reporting() has synopsis

int error_reporting  ([ int $level  ] )

which suggests it can be called without any argument and I indeed saw such a call, but I have no idea what level is set then because the default value is not documented.
http://ca2.php.net/manual/en/function.error-reporting.php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-14 09:28 UTC] rquadling@php.net
The level is optional and does not have a default value, though I 
suppose you could argue that the default is the current error_reporting 
level.

 [2009-10-14 09:33 UTC] chealer at gmail dot com
Whatever interpretation you like, this is not a bogus issue. The 
effect of calling error_reporting() is not documented.
 [2009-10-14 09:39 UTC] rquadling@php.net
That's the point. There is no effect.

The return value is documented. Supplying the optional value sets the 
level to the supplied optional value.

The parameter of "level" also shows that the value you supply is the new 
level you want to set.

So. Everything covered.

error_reporting() will return the current level.
error_reporting(xxx) will return the current level and then set it to 
the supplied level.

 [2009-10-14 17:42 UTC] chealer at gmail dot com
Yet the synopsis reads "Sets which PHP errors are reported".
If this only happens in some cases, the synopsis is incorrect.
"Get the current error_reporting level, optionally changing it" 
might fix, but I'm sure there is a better modification to make 
things crystal-clear.
 [2009-12-11 04:49 UTC] chealer at gmail dot com
Could someone please fix the status?
 [2018-12-26 23:27 UTC] chealer at gmail dot com
This was reported in ticket #50548. The issue was solved since.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 09:00:02 2026 UTC