]> granicus.if.org Git - php/commitdiff
add failing test for bug #70868
authorMárcio Almada <marcio3w@gmail.com>
Fri, 6 Nov 2015 01:20:49 +0000 (22:20 -0300)
committerXinchen Hui <laruence@gmail.com>
Fri, 6 Nov 2015 03:34:45 +0000 (11:34 +0800)
Zend/tests/bug70868.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug70868.phpt b/Zend/tests/bug70868.phpt
new file mode 100644 (file)
index 0000000..d3dd763
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Bug #70868, with PCRE JIT
+--INI--
+pcre.jit=1
+--SKIPIF--
+<?php if (!extension_loaded("pcre")) die("skip"); ?>
+--FILE--
+<?php
+
+namespace X;
+
+$iterator =
+    new \RegexIterator(
+        new \ArrayIterator(['A.phpt', 'B.phpt', 'C.phpt']),
+        '/\.phpt$/'
+    )
+;
+
+foreach ($iterator as $foo) {
+    var_dump($foo);
+    preg_replace('/\.phpt$/', '', '');
+}
+
+echo "Done", PHP_EOL;
+
+?>
+--EXPECTF--
+
+string(6) "A.phpt"
+string(6) "B.phpt"
+string(6) "C.phpt"
+Done