Arquivos
hhvm/hphp/test/slow/filesystem_iterator/rewind.php
T
Paul Tarjan 992cd4efb6 add FilesystemIterator
This was inserted as a class inbetween RecursiveArrayIterator and DirectoryIterator. Sadly our RecursiveArrayIterator implementaiton is crazy and calls into C++ which can't call back up to `parent::method()`. I'll fix RecursiveArrayIterator in another diff.
2013-05-30 17:32:59 -07:00

16 linhas
292 B
PHP

<?php
$sample_dir = __DIR__.'/../../sample_dir';
$iterator = new FilesystemIterator(
$sample_dir,
FilesystemIterator::KEY_AS_FILENAME
);
$a = $iterator->key();
$iterator->next();
$b = $iterator->key();
$iterator->rewind();
$c = $iterator->key();
var_dump($a == $b);
var_dump($a == $c);