]> granicus.if.org Git - php/blob
abf64f8d9d
[php] /
1 --TEST--
2 SPL: SplHeap, test trivial method to find if a heap is empty
3 --CREDITS--
4 Nathaniel McHugh nat@fishtrap.co.uk
5 #testfest London 2009-05-09
6 --FILE--
7 <?php
8
9 class MyHeap extends SplHeap{
10
11 public function compare($a, $b){
12 return $a < $b;
13 }
14
15 }
16
17
18 $heap = new MyHeap();
19 var_dump($heap->isEmpty());
20 $heap->insert(1);
21 var_dump($heap->isEmpty());
22 $heap->extract();
23 var_dump($heap->isEmpty());
24 ?>
25 --EXPECT--
26 bool(true)
27 bool(false)
28 bool(true)