summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-05-26 02:18:17 (GMT)
committerFelipe Pena <felipe@php.net>2010-05-26 02:18:17 (GMT)
commitde531056f7d002a5b0fea12c1e320e2abe2823c2 (patch)
treefa7145670f3dcedd18e970f27da8390f95e04705 /ext
parent79d2aaf0f1775f89a775b2d2d793dff8bb0e7755 (diff)
downloadphp-de531056f7d002a5b0fea12c1e320e2abe2823c2.tar.gz
- Fixed bug #51899 (Parse error in parse_ini_file() function when empy value followed by no newline)
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) {
+}