#44842 [Ctl->Csd]: parse_ini_file keys that start/end with underscore

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               44842
 Updated by:       [email protected]
 Reported By:      galactic dot void at googlemail dot com
-Status:           Critical
+Status:           Closed
 Bug Type:         Filesystem function related
 Operating System: *
 PHP Version:      5.3CVS-2008-04-26 (snap)
 New Comment:

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.




Previous Comments:
------------------------------------------------------------------------

[2008-04-26 17:12:21] 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
)



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44842&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.