Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / spl / tests / dit_006.phpt
blob1e627a20e0adc91a34527cb6463e575d1a816e0b
1 --TEST--
2 SPL: DirectoryIterator and seek
3 --FILE--
4 <?php
5 $di = new DirectoryIterator(__DIR__);
6 $di->seek(2);
8 $n = 0;
9 while ($di->valid()) {
10     $n++;
11     $di->next();
14 echo "With seek(2) we get $n\n";
15 $di->seek(0);
17 $m = 0;
18 while ($di->valid()) {
19     $m++;
20     $di->next();
22 echo "With seek(0) we get $m\n";
24 $o = 0;
25 $di->rewind();
26 while ($di->valid()) {
27     $o++;
28     $di->next();
31 echo "Without seek we get $o\n";
33 $p = 0;
34 $di->seek($o+1);
35 while ($di->valid()) {
36     $p++;
37     $di->next();
40 var_dump($n !== $m, $m === $o, $p === 0);
42 ===DONE===
43 --EXPECTF--
44 With seek(2) we get %d
45 With seek(0) we get %d
46 Without seek we get %d
47 bool(true)
48 bool(true)
49 bool(true)
50 ===DONE===