Annotation of embedaddon/php/ext/spl/tests/pqueue_003.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: SplPriorityQueue: iteration through methods
! 3: --FILE--
! 4: <?php
! 5: $h = new SplPriorityQueue();
! 6:
! 7: $h->insert(1, 1);
! 8: $h->insert(5, 5);
! 9: $h->insert(0, 0);
! 10: $h->insert(4, 4);
! 11:
! 12: $h->rewind();
! 13: echo "count(\$h) = ".count($h)."\n";
! 14: echo "\$h->count() = ".$h->count()."\n";
! 15: while ($h->valid()) {
! 16: $k = $h->key();
! 17: $v = $h->current();
! 18: echo "$k=>$v\n";
! 19: $h->next();
! 20: }
! 21: ?>
! 22: ===DONE===
! 23: <?php exit(0); ?>
! 24: --EXPECTF--
! 25: count($h) = 4
! 26: $h->count() = 4
! 27: 3=>5
! 28: 2=>4
! 29: 1=>1
! 30: 0=>0
! 31: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>