|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-04-30 09:51 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
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 )