summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/tests/strings/bug51899.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/bug51899.phpt b/ext/standard/tests/strings/bug51899.phpt
new file mode 100644
index 0000000..fb430cf
--- /dev/null
+++ b/ext/standard/tests/strings/bug51899.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #51899 (Parse error in parse_ini_file() function when empy value followed by no newline)
+--FILE--
+<?php
+
+var_dump(parse_ini_string('a='));
+var_dump(parse_ini_string('a= '));
+var_dump(parse_ini_string('a='.PHP_EOL));
+var_dump(parse_ini_string('a=b '));
+var_dump(parse_ini_string(''));
+var_dump(parse_ini_string(NULL));
+var_dump(parse_ini_string("\0"));
+
+?>
+--EXPECT--
+array(1) {
+ ["a"]=>
+ string(0) ""
+}
+array(1) {
+ ["a"]=>
+ string(0) ""
+}
+array(1) {
+ ["a"]=>
+ string(0) ""
+}
+array(1) {
+ ["a"]=>
+ string(2) "b "
+}
+array(0) {
+}
+array(0) {
+}
+array(0) {
+}