xref: /PHP-8.1/ext/spl/tests/bug36287.phpt (revision f8d79582)
1--TEST--
2Bug #36287 (Segfault with SplFileInfo conversion)
3--FILE--
4<?php
5
6$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator("."), true);
7
8$idx = 0;
9foreach($it as $file)
10{
11    echo "First\n";
12    var_Dump($file->getFilename());
13    echo "Second\n";
14    var_dump($file->getFilename());
15    if (++$idx > 1)
16    {
17        break;
18    }
19}
20
21?>
22--EXPECTF--
23First
24string(%d) "%s"
25Second
26string(%d) "%s"
27First
28string(%d) "%s"
29Second
30string(%d) "%s"
31