summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-08-18 14:37:04 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-08-18 14:37:48 +0200
commit41d2102c776f03a725a2a9bf13bb0bcf7e3025cd (patch)
treedb44f84536c682ff4fc874099098c9dfcfb0e8eb
parent4aa5065bb09797e0bc25668de7759dc4f7c6ab48 (diff)
parent4c448334bdfe61c8c2a0b3c3d5797d5ff31d4ca0 (diff)
downloadphp-git-41d2102c776f03a725a2a9bf13bb0bcf7e3025cd.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: 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 eee950fe8a..0e9743f25d 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,10 @@ PHP NEWS
. Fixed bug #76595 (phpdbg man page contains outdated information).
(Kevin Abel)
+- SPL:
+ . Fixed bug #68175 (RegexIterator pregFlags are NULL instead of 0). (Tim
+ Siebels)
+
- zlib:
. Fixed bug #65988 (Zlib version check fails when an include/zlib/ style dir
is passed to the --with-zlib configure option). (Jay Bonci)
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 47b076300a..c38a95b7f7 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2208,7 +2208,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===