summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-08-18 14:38:44 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-08-18 14:39:15 +0200
commitbe2447fb7c313663ebb3dfeb8ef639ff0cfb4c13 (patch)
tree657f89fbe886ea262f89894fcc0213610dbcc31f
parent990a404c2d285b50ba487689e5d454c2ee778bcc (diff)
parent41d2102c776f03a725a2a9bf13bb0bcf7e3025cd (diff)
downloadphp-git-be2447fb7c313663ebb3dfeb8ef639ff0cfb4c13.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Add regression test for bug #68175 Fix #68175: RegexIterator pregFlags are NULL instead of 0
-rw-r--r--NEWS4
-rw-r--r--ext/spl/spl_iterators.c2
-rw-r--r--ext/spl/tests/bug68175.phpt18
3 files changed, 23 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 971a92fb73..f6a888fbad 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,10 @@ PHP NEWS
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
file). (Laruence)
+- SPL:
+ . Fixed bug #68175 (RegexIterator pregFlags are NULL instead of 0). (Tim
+ Siebels)
+
- Standard:
. Fixed bug #76755 (setcookie does not accept "double" type for expire time).
(Laruence)
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 2ddb7b2a4f..23fa58a4b1 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2202,7 +2202,7 @@ SPL_METHOD(RegexIterator, getPregFlags)
if (intern->u.regex.use_flags) {
RETURN_LONG(intern->u.regex.preg_flags);
} else {
- return;
+ RETURN_LONG(0);
}
} /* }}} */
diff --git a/ext/spl/tests/bug68175.phpt b/ext/spl/tests/bug68175.phpt
new file mode 100644
index 0000000000..bba769b23b
--- /dev/null
+++ b/ext/spl/tests/bug68175.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #68175 (RegexIterator pregFlags are NULL instead of 0)
+--FILE--
+<?php
+$arr = new ArrayIterator(array());
+$regex = new RegexIterator($arr, '/^test/');
+var_dump(
+ $regex->getMode(),
+ $regex->getFlags(),
+ $regex->getPregFlags()
+);
+?>
+===DONE===
+--EXPECT--
+int(0)
+int(0)
+int(0)
+===DONE===