summaryrefslogtreecommitdiff
path: root/ext/spl/tests/pqueue_003.phpt
blob: 9c0b5a5147cfb385dde3289288be0e9135f72714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--TEST--
SPL: SplPriorityQueue: iteration through methods
--FILE--
<?php
$h = new SplPriorityQueue();

$h->insert(1, 1);
$h->insert(5, 5);
$h->insert(0, 0);
$h->insert(4, 4);

$h->rewind();
echo "count(\$h) = ".count($h)."\n";
echo "\$h->count() = ".$h->count()."\n";
while ($h->valid()) {
    $k = $h->key();
    $v = $h->current();
    echo "$k=>$v\n";
    $h->next();
}
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
count($h) = 4
$h->count() = 4
3=>5
2=>4
1=>1
0=>0
===DONE===