xref: /PHP-8.4/ext/spl/tests/pqueue_004.phpt (revision a555cc0b)
1--TEST--
2SPL: SplPriorityQueue: var_dump
3--FILE--
4<?php
5$pq = new SplPriorityQueue();
6
7$pq->insert("a", 0);
8$pq->insert("b", 1);
9$pq->insert("c", 5);
10$pq->insert("d", -2);
11
12var_dump($pq);
13?>
14--EXPECT--
15object(SplPriorityQueue)#1 (3) {
16  ["flags":"SplPriorityQueue":private]=>
17  int(1)
18  ["isCorrupted":"SplPriorityQueue":private]=>
19  bool(false)
20  ["heap":"SplPriorityQueue":private]=>
21  array(4) {
22    [0]=>
23    array(2) {
24      ["data"]=>
25      string(1) "c"
26      ["priority"]=>
27      int(5)
28    }
29    [1]=>
30    array(2) {
31      ["data"]=>
32      string(1) "a"
33      ["priority"]=>
34      int(0)
35    }
36    [2]=>
37    array(2) {
38      ["data"]=>
39      string(1) "b"
40      ["priority"]=>
41      int(1)
42    }
43    [3]=>
44    array(2) {
45      ["data"]=>
46      string(1) "d"
47      ["priority"]=>
48      int(-2)
49    }
50  }
51}
52