mirror of
https://github.com/php/php-src.git
synced 2026-04-19 05:51:02 +02:00
Files
d8590b1affb802b3e19ee097cf7afd7f4e6e4e4a
29 lines
439 B
PHP
29 lines
439 B
PHP
--TEST--
|
|
SPL: SplHeap, test trivial method to find if a heap is empty
|
|
--CREDITS--
|
|
Nathaniel McHugh nat@fishtrap.co.uk
|
|
#testfest London 2009-05-09
|
|
--FILE--
|
|
<?php
|
|
|
|
class MyHeap extends SplHeap{
|
|
|
|
public function compare($a, $b){
|
|
return $a < $b;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
$heap = new MyHeap();
|
|
var_dump($heap->isEmpty());
|
|
$heap->insert(1);
|
|
var_dump($heap->isEmpty());
|
|
$heap->extract();
|
|
var_dump($heap->isEmpty());
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(false)
|
|
bool(true)
|