2007-08-21 22:45:53 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #42364 (Crash when using getRealPath with DirectoryIterator)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-02-19 15:15:01 +00:00
|
|
|
$dir = __DIR__ . '/bug42364';
|
|
|
|
@mkdir($dir);
|
|
|
|
touch($dir . '/test');
|
2007-08-21 22:45:53 +00:00
|
|
|
|
2007-11-02 19:41:12 +00:00
|
|
|
$count = 0;
|
2019-02-19 15:15:01 +00:00
|
|
|
$it = new DirectoryIterator($dir);
|
2007-08-21 22:45:53 +00:00
|
|
|
foreach ($it as $e) {
|
2007-11-02 19:41:12 +00:00
|
|
|
$count++;
|
|
|
|
$type = gettype($e->getRealPath());
|
|
|
|
if ($type != "string" && $type != "unicode") {
|
2007-08-21 22:45:53 +00:00
|
|
|
echo $e->getFilename(), " is a ", gettype($e->getRealPath()), "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-02 19:41:12 +00:00
|
|
|
if ($count > 0) {
|
|
|
|
echo "Found $count entries!\n";
|
|
|
|
}
|
2009-07-05 14:46:08 +00:00
|
|
|
?>
|
|
|
|
===DONE===
|
2019-02-19 15:15:01 +00:00
|
|
|
--CLEAN--
|
2019-04-02 21:24:21 +00:00
|
|
|
<?php
|
|
|
|
unlink(__DIR__ . '/bug42364/test');
|
|
|
|
rmdir(__DIR__ . '/bug42364');
|
|
|
|
?>
|
2007-11-02 19:41:12 +00:00
|
|
|
--EXPECTF--
|
|
|
|
Found %i entries!
|
2007-08-21 22:45:53 +00:00
|
|
|
===DONE===
|