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
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 !
Your email address:
MUST BE VALID
Solve the problem:
39 + 12 = ?
Subscribe to this entry?

 
 [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: Wed Oct 09 07:01:28 2024 UTC