#26006 [Com]: error_reporting() and @ problem

From: Date: Mon, 27 Oct 2003 18:03:13 +0000
Subject: #26006 [Com]: error_reporting() and @ problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-49528@lists.php.net to get a copy of this message
ID: 26006 Comment by: kiril at lycos dot com Reported By: gms08701 at yahoo dot com Status: Open Bug Type: *General Issues Operating System: FreeBSD 4.8-RELEASE-p10 PHP Version: 4.3.3 New Comment: Verified using the following setup: Win2K SP4 Apache/2.0.47 PHP 4.3.3 php.ini error reporting values: error_reporting = E_ALL display_errors = On log_errors = On All other error reporting values set at defaults. Previous Comments: ------------------------------------------------------------------------ [2003-10-27 11:07:49] gms08701 at yahoo dot com Description: ------------ To my knowledge, when using @ at a function/variable/etc, it sets error_reporting to 0 at that instance, and return, to its previous state, after that instance. Unfortunately, after the instance of @, instead of returning to what it was set at previously, it returns to what is set in php.ini Reproduce code: --------------- --y.php-- <?php // error_reporting is currently at E_ALL (set from php.ini) // Set error_reporting to 0 error_reporting(0); // Returns 0 here var_dump(error_reporting()); ?> --z.php-- <?php @require('./y.php'); // This returns 2047 (E_ALL) var_dump(error_reporting()); ?> Expected result: ---------------- Its expected that z.php should return 0 from the var_dump(), where it inherits its error_reporting value from y.php, but is currently returning 2047 (E_ALL) When I remove '@' from require('./y.php'); in z.php, it then works correctly. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26006&edit=1

« previous php.bugs (#49528) next »