|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41317 ini_get does not return default value if variables_order is not set
Submitted: 2007-05-07 18:24 UTC Modified: 2007-05-07 21:25 UTC
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tokul at users dot sourceforge dot net Assigned:
Status: Wont fix Package: PHP options/info functions
PHP Version: 4CVS-2007-05-07 (snap) OS: Linux Debian Etch
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: tokul at users dot sourceforge dot net
New email:
PHP Version: OS:


 [2007-05-07 18:24 UTC] tokul at users dot sourceforge dot net
In PHP 4.x ini_get function does not return default variables_order value, if it is not set in PHP_INI_ALL locations.

Tested PHP version
* 5.2.0-8 (stock debian etch) - returns EGPCS
* php4-STABLE-200705071630 - returns boolean false
* php5.2-200705071630 - returns EGPCS
* php6.0-200705071630 - returns EGPCS

All snapshots are compiled only with --prefix, --with-config-file-path and --with-apxs2 options. All use empty php.ini file.

I recommend returning default value instead of false, if configuration value is not present in configuration file. Or make sure that behavior is consistent between PHP versions and configuration variables. For example, if gpc_order is missing in php.ini, ini_get() still returns 'GPC' in php 4.x.

Reproduce code:

Expected result:
string(5) "EGPCS"

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-07 21:25 UTC]
We can not change this in 4, as this would make PHP 4 in itself inconsistent.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Sep 22 01:01:23 2020 UTC