php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16137 ini_set / error_reporting inconsistence
Submitted: 2002-03-18 04:20 UTC Modified: 2002-11-17 17:04 UTC
From: goba@php.net Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 4.3.0-dev 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: goba@php.net
New email:
PHP Version: OS:

 

 [2002-03-18 04:20 UTC] goba@php.net
Consider the code below, with error_repoting set to
E_ALL (2047) before the script start:

<?php 

$prev = error_reporting();
error_reporting(2046);
$new = error_reporting();

echo $prev . " -> " . $new;

//ini_set("error_reporting", $new);

phpinfo();

?>

This would set the error_reporting to 2046,
as returned and injected to the $new variable.
BUT phpinfo() will present 2047 as the local
value, instead of 2046. If you uncomment the
ini_set() call, you get the correct 2046 in the
phpindo() output. So error_repoting(..) and
ini_set("error_reporting"..) are not the same ;((

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-18 06:29 UTC] goba@php.net
I have not tested this with ini_get, but IMHO

a) error_reporting() should be an alias for
   ini_get("error_reporting")

and

b) error_reporting(E_ALL) should be an alias for
   ini_set("error_reporting", E_ALL)...

Goba
 [2002-11-17 17:04 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 12:01:23 2020 UTC