xref: /PHP-8.1/ext/spl/tests/bug78436.phpt (revision 13e92223)
1--TEST--
2Bug #78436: Missing addref in SplPriorityQueue EXTR_BOTH mode
3--FILE--
4<?php
5
6$pq = new SplPriorityQueue();
7$pq->insert(new stdClass, 1);
8var_dump($pq);
9var_dump($pq);
10
11?>
12--EXPECT--
13object(SplPriorityQueue)#1 (3) {
14  ["flags":"SplPriorityQueue":private]=>
15  int(1)
16  ["isCorrupted":"SplPriorityQueue":private]=>
17  bool(false)
18  ["heap":"SplPriorityQueue":private]=>
19  array(1) {
20    [0]=>
21    array(2) {
22      ["data"]=>
23      object(stdClass)#2 (0) {
24      }
25      ["priority"]=>
26      int(1)
27    }
28  }
29}
30object(SplPriorityQueue)#1 (3) {
31  ["flags":"SplPriorityQueue":private]=>
32  int(1)
33  ["isCorrupted":"SplPriorityQueue":private]=>
34  bool(false)
35  ["heap":"SplPriorityQueue":private]=>
36  array(1) {
37    [0]=>
38    array(2) {
39      ["data"]=>
40      object(stdClass)#2 (0) {
41      }
42      ["priority"]=>
43      int(1)
44    }
45  }
46}
47