Bug #74515 [Ver]: ini setting for error_reporting not initialized by default

From: Date: Mon, 01 May 2017 19:18:47 +0000
Subject: Bug #74515 [Ver]: ini setting for error_reporting not initialized by default
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208887@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74515&edit=1 ID: 74515 User updated by: raat1979 at gmail dot com Reported by: raat1979 at gmail dot com Summary: ini setting for error_reporting not initialized by default Status: Verified Type: Bug Package: *Configuration Issues Operating System: Ubuntu Linux PHP Version: 7.1.4 Block user comment: N Private report: N New Comment: It get's even more weird if we check ini_get_all() <?php print_r(ini_get_all()['error_reporting']); error_reporting(error_reporting()); print_r(ini_get_all()['error_reporting']); ?> outputs: Array ( [global_value] => [local_value] => [access] => 7 ) Array ( [global_value] => 22519 [local_value] => 22519 [access] => 7 ) Previous Comments: ------------------------------------------------------------------------ [2017-04-30 09:51:02] raat1979 at gmail dot com Description: ------------ If no error_reporting is defined ( not in php.ini, not in .htaccess, not in source) then ini_get('error_reporting') returns an empty string. however, error_reporting() does return a value ("22519" on 7.1.4) in addition phpinfo() shows master value: "no value" local Value: "22519" after setting error_reporting to the current error_reporting() value the ini value is suddenly set Test script: --------------- <?php echo "<pre>"; var_dump(ini_get('error_reporting')); var_dump(error_reporting()); error_reporting(error_reporting()); var_dump(ini_get('error_reporting')); var_dump(error_reporting()); Expected result: ---------------- /var/www/127.0.0.1/index.php:4:string '22519' (length=5) /var/www/127.0.0.1/index.php:5:int 22519 /var/www/127.0.0.1/index.php:8:string '22519' (length=5) /var/www/127.0.0.1/index.php:9:int 22519 Actual result: -------------- /var/www/127.0.0.1/index.php:4:string '' (length=0) /var/www/127.0.0.1/index.php:5:int 22519 /var/www/127.0.0.1/index.php:8:string '22519' (length=5) /var/www/127.0.0.1/index.php:9:int 22519 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74515&edit=1

« previous php.bugs (#208887) next »