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