xref: /PHP-8.4/ext/spl/tests/bug61418.phpt (revision 85725337)
1--TEST--
2Bug #61418: Segmentation fault using FiltesystemIterator & RegexIterator
3--FILE--
4<?php
5$fileIterator = new FilesystemIterator(__DIR__, FilesystemIterator::KEY_AS_FILENAME);
6$regexpIterator = new RegexIterator($fileIterator, '#.*#');
7foreach ($fileIterator as $key => $file)
8{
9}
10unset($regexpIterator);
11unset($fileIterator);
12
13$dirIterator = new DirectoryIterator(__DIR__);
14$regexpIterator2 = new RegexIterator($dirIterator, '#.*#');
15foreach ($dirIterator as $key => $file)
16{
17}
18unset($regexpIterator2);
19unset($dirIterator);
20?>
21==DONE==
22--EXPECT--
23==DONE==
24