php.net |  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
Votes:1
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
50 + 10 = ?
Subscribe to this entry?

 
 [2007-05-07 18:24 UTC] tokul at users dot sourceforge dot net
Description:
------------
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:
---------------
var_dump(ini_get('variables_order'));

Expected result:
----------------
string(5) "EGPCS"

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-07 21:25 UTC] derick@php.net
We can not change this in 4, as this would make PHP 4 in itself inconsistent.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 11:01:24 2019 UTC