ID: 51094 User updated by: viaujoc at videotron dot ca Reported By: viaujoc at videotron dot ca Status: Bogus Bug Type: Filesystem function related Operating System: Win2003 PHP Version: 5.3.1 New Comment:
This change in the behavior of parse_ini_file() is not documented in either the documentation page for the function or the "Backward Incompatible Changes" from "Migrating from PHP 5.2.x to PHP 5.3.x". I also hope that the updated documentation promised in bug #47703 will be published soon. Previous Comments: ------------------------------------------------------------------------ [2010-02-20 10:54:50] j...@php.net 1. There is no such thing as raw scanning in PHP 5.2 2. This is exactly how it's supposed to work. The ; is still comment even in the raw mode. All other chars are considered just chars. 3. In PHP 5.3 the backslash inside double quotes is considered escape char. No bug here either. Use single quotes instead. ------------------------------------------------------------------------ [2010-02-19 22:10:16] viaujoc at videotron dot ca Description: ------------ When using parse_ini_file() function with $scanner_mode=INI_SCANNER_RAW, any semi-colon (;) in the value is seen as the end of the value, even if it is enclosed in quotes. The behavior of parse_ini_file() in PHP 5.3 with either $scanner_mode at RAW or NORMAL cannot reproduce the behavior of PHP 5.2. Reproduce code: --------------- test.ini: [TheSection] MyKey="my;value\$" example.php: <?php var_dump(parse_ini_file("test.ini",true,INI_SCANNER_RAW)); ?> Expected result: ---------------- array(1) { ["TheSection"]=> array(1) { ["MyKey"]=> string(10) "my;value\$" } } Actual result: -------------- In PHP 5.2 (without the $scanner_mode parameter in parse_ini_file()): array(1) { ["TheSection"]=> array(1) { ["MyKey"]=> string(10) "my;value\$" } } (the value is returned exactly as it appears in test.ini) In PHP 5.3 (with $scanner_mode=INI_SCANNER_RAW): array(1) { ["TheSection"]=> array(1) { ["MyKey"]=> string(3) ""my" } } (notice that everything after the semi-colon has been truncated and the quote as the first character of the string) In PHP 5.3 (with $scanner_mode=INI_SCANNER_NORMAL): array(1) { ["TheSection"]=> array(1) { ["MyKey"]=> string(9) "my;value$" } } (notice the missing backslash (\) between the "e" and "$") ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51094&edit=1