xref: /PHP-8.3/ext/spl/tests/spl_heap_isempty.phpt (revision d679f022)
1--TEST--
2SPL: Test of isEmpty for SPL Max Heap
3--CREDITS--
4Rohan Abraham (rohanabrahams@gmail.com)
5TestFest London May 2009
6--FILE--
7<?php
8  $h = new SplMaxHeap();
9  echo "Checking a new heap is empty: ";
10  var_dump($h->isEmpty())."\n";
11  $h->insert(2);
12  echo "Checking after insert: ";
13  var_dump($h->isEmpty())."\n";
14  $h->extract();
15  echo "Checking after extract: ";
16  var_dump($h->isEmpty())."\n";
17?>
18--EXPECT--
19Checking a new heap is empty: bool(true)
20Checking after insert: bool(false)
21Checking after extract: bool(true)
22