php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44842 parse_ini_file keys that start/end with underscore
Submitted: 2008-04-26 17:12 UTC Modified: 2008-08-17 21:59 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: galactic dot void at googlemail dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 5.3CVS-2008-04-26 (snap) OS: *
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: galactic dot void at googlemail dot com
New email:
PHP Version: OS:

 

 [2008-04-26 17:12 UTC] galactic dot void at googlemail dot com
Description:
------------
parse_ini_file cannot handle keys that start/end with an underscore.

Reproduce code:
---------------
// my.ini
test   = 1
_test  = 2
test_  = 3

[section]
test  = 1
_test = 2
test_ = 3

// ini.php
print_r(parse_ini_file('my.ini', true));

Expected result:
----------------
Array
(
    [test] => 1
    [_test] => 2
    [test_] => 3
    [section] => Array
        (
            [test] => 1
            [_test] => 2
            [test_] => 3
        )

)


Actual result:
--------------
Array
(
    [test] => 1
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-17 21:59 UTC] lbarnaud@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC