[DOC] parse_ini_file(): comments starting with # are deprecated in PHP 5.3
(comments starting with ; should be used instead)
- Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). (Ilia)
- Fixed bug #45382 (timeout bug in stream_socket_enable_crypto).
(vnegrier at optilian dot com, Ilia)
+- Fixed bug #44575 (parse_ini_file comment # line problems). (Arnaud)
- Fixed bug #44135 (PDO MySQL does not support CLIENT_FOUND_ROWS). (Johannes,
chx1975 at gmail dot com)
return END_OF_LINE;
}
+<INITIAL>{TABS_AND_SPACES}*[#][^\r\n]*{NEWLINE} { /* #Comment */
+ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", ini_filename, SCNG(lineno));
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+
<ST_VALUE,ST_RAW>[^] { /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
file_put_contents($filename, $ini);
var_dump(parse_ini_file($filename, true));
+/* #44575, comments starting with '#' */
+$ini = <<<'INI'
+foo=bar1
+; comment
+_foo=bar2
+# comment
+foo_=bar3
+INI;
+file_put_contents($filename, $ini);
+var_dump(parse_ini_file($filename, true));
+
+
@unlink($filename);
echo "Done\n";
?>
["foo_"]=>
string(4) "bar3"
}
+
+Deprecated: Comments starting with '#' are deprecated in %s
+array(3) {
+ ["foo"]=>
+ string(4) "bar1"
+ ["_foo"]=>
+ string(4) "bar2"
+ ["foo_"]=>
+ string(4) "bar3"
+}
Done