xref: /PHP-7.2/ext/spl/tests/bug42364.phpt (revision 7eb70247)
1--TEST--
2Bug #42364 (Crash when using getRealPath with DirectoryIterator)
3--FILE--
4<?php
5$it = new DirectoryIterator(dirname(__FILE__));
6
7$count = 0;
8
9foreach ($it as $e) {
10    $count++;
11    $type = gettype($e->getRealPath());
12    if ($type != "string" && $type != "unicode") {
13        echo $e->getFilename(), " is a ", gettype($e->getRealPath()), "\n";
14    }
15}
16
17if ($count > 0) {
18    echo "Found $count entries!\n";
19}
20?>
21===DONE===
22--EXPECTF--
23Found %i entries!
24===DONE===
25