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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC