ID: 49443 User updated by: eric dot caron at gmail dot com Reported By: eric dot caron at gmail dot com Status: Bogus Bug Type: Filesystem function related Operating System: N/A PHP Version: 5.3.0 New Comment:
The raw option, though, does not convert the string "true"/"false" to its boolean. If you change the print_r in my demo code to a var_dump: *** PHP 5.2 RESULTS *** array(2) { ["Ask"]=> array(1) { ["Crawler"]=> string(1) "1" } ["Mozilla/?.0 (compatible; Ask Jeeves/Teoma*)"]=> array(1) { ["Crawler"]=> string(1) "1" } } *** PHP 5.3 RESULTS *** array(2) { ["Ask"]=> array(1) { ["Crawler"]=> string(4) "true" } ["Mozilla/?.0 (compatible; Ask Jeeves/Teoma*)"]=> array(1) { ["Crawler"]=> string(4) "true" } } Previous Comments: ------------------------------------------------------------------------ [2009-09-02 19:12:19] j...@php.net The raw option is just for this and it's NOT a workaround but exactly the thing you're supposed to use here. No bug here. ------------------------------------------------------------------------ [2009-09-02 15:52:10] eric dot caron at gmail dot com Description: ------------ PHP 5.3 changes to parse_ini_*() functions breaks scripts that have special characters, {}|&~![()^", in the section titles. (Previous versions worked, which I assume was proper behavior because section titles can have those characters according to community understood INI standards). There is no documentation stating that special characters can not be used in section titles. While the INI_SCANNER_RAW parameter provides an opening for a workaround for this solution, to be useful, the characters {}|&~![()^" should be usable in section titles (not to be confuse with keys, where they shouldn't be used). Reproduce code: --------------- <?php $tmpfname = tempnam("/tmp", "FOO"); file_put_contents($tmpfname, '[Ask] Crawler=true [Mozilla/?.0 (compatible; Ask Jeeves/Teoma*)] Crawler=true '); $array = parse_ini_file($tmpfname, true); print_r($array); unlink($tmpfname); Expected result: ---------------- Array ( [Ask] => Array ( [Crawler] => 1 ) [Mozilla/?.0 (compatible; Ask Jeeves/Teoma*)] => Array ( [Crawler] => 1 ) ) Actual result: -------------- Warning: parse error, expecting `']'' in FOOFCCA.tmp on line 4 in parseBug.php on line 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49443&edit=1