xref: /PHP-7.2/ext/spl/tests/bug70868.phpt (revision f1d7e3ca)
1--TEST--
2Bug #70868, with PCRE JIT
3--INI--
4pcre.jit=1
5--SKIPIF--
6<?php if (!extension_loaded("pcre")) die("skip"); ?>
7--FILE--
8<?php
9
10namespace X;
11
12$iterator =
13    new \RegexIterator(
14        new \ArrayIterator(['A.phpt', 'B.phpt', 'C.phpt']),
15        '/\.phpt$/'
16    )
17;
18
19foreach ($iterator as $foo) {
20    var_dump($foo);
21    preg_replace('/\.phpt$/', '', '');
22}
23
24echo "Done", PHP_EOL;
25
26?>
27--EXPECTF--
28string(6) "A.phpt"
29string(6) "B.phpt"
30string(6) "C.phpt"
31Done
32