From:             gabe at mudbugmedia dot com
Operating system: Linux proto 2.6.20-hardened-r5
PHP version:      5CVS-2007-09-24 (snap)
PHP Bug Type:     Output Control
Bug description:  error_reporting() SOMETIMES does not have any affect

Description:
------------
Periodically PHP stops respecting calls to error_reporting() to alter 
the current error level away from the system default specified in 
php.ini. All calls to error_reporting() for the current connection 
will not update the actual level. This behavior will occur with only 
*some* of the connections, but not all of them. Reloading the page 
(after waiting for the keep alive to time out) will sometimes result 
in the expected behavior, and others will result in the erroneous 
behavior.  Restarting Apache (running 2.2.6 with mod_php) seems to 
briefly fix the problem, but it eventually returns.

This behavior also occurs when trying to set the error reporting level 
via .htaccess such as:
php_value "E_ALL ^ E_NOTICE"
when this occurs, a phpinfo() call shows that the error reporting 
level has defaulted back to the system-wide default (specified in 
php.ini) and ignores the php_value statement all together.  Again, 
this is behavior that only happens *sometimes* and alters between page 
reloads.


As a side effect, this causes all supporting libraries that rely on 
error suppression, like Smarty, to throw errors.






Reproduce code:
---------------
<?php
var_dump(error_reporting());

var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE));
trigger_error('This should not be seen', E_USER_NOTICE);
echo $a; // should cause a notice
var_dump(error_reporting());

?>



Expected result:
----------------
int(6143)
int(6143)
int(5111)






Actual result:
--------------
int(6143)
int(6143)
<br />
<b>Notice</b>:  This should not be seen in
<b>/home/gabebug/public_html/error_reporting_tests.php</b> on line 
<b>5</b><br
/>
<br />
<b>Notice</b>:  Undefined variable: a in
<b>/home/gabebug/public_html/error_reporting_tests.php</b> on line 
<b>6</b><br
/>

int(6143)





-- 
Edit bug report at http://bugs.php.net/?id=42749&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42749&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42749&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42749&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42749&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42749&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42749&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42749&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42749&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42749&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42749&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42749&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42749&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42749&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42749&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42749&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42749&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42749&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42749&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42749&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42749&r=mysqlcfg

Reply via email to