summaryrefslogtreecommitdiff
path: root/ext/spl/tests/pqueue_003.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/pqueue_003.phpt')
-rw-r--r--ext/spl/tests/pqueue_003.phpt31
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/spl/tests/pqueue_003.phpt b/ext/spl/tests/pqueue_003.phpt
new file mode 100644
index 0000000..9c0b5a5
--- /dev/null
+++ b/ext/spl/tests/pqueue_003.phpt
@@ -0,0 +1,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===