php-src/ext/spl/tests/heap_007.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

33 lines
451 B
PHP

--TEST--
SPL: SplHeap: iteration through methods
--FILE--
<?php
$h = new SplMaxHeap();
$h->insert(1);
$h->insert(5);
$h->insert(0);
$h->insert(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); ?>
--EXPECT--
count($h) = 4
$h->count() = 4
3=>5
2=>4
1=>1
0=>0
===DONE===