#16137 [Opn->Ver]: ini_set / error_reporting inconsistence

From: Date: Thu, 24 Oct 2002 21:31:40 +0000
Subject: #16137 [Opn->Ver]: ini_set / error_reporting inconsistence
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-23251@lists.php.net to get a copy of this message
ID: 16137 Updated by: iliaa@php.net Reported By: goba@php.net -Status: Open +Status: Verified Bug Type: PHP options/info functions -Operating System: win2k +Operating System: All -PHP Version: 4.1.0 +PHP Version: 4.3.0-dev Previous Comments: ------------------------------------------------------------------------ [2002-03-18 06:29:24] 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-03-18 04:20:46] 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 ;(( ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16137&edit=1

« previous php.bugs (#23251) next »