xref: /PHP-8.2/Zend/tests/gc_043.phpt (revision adb45a63)
1--TEST--
2GC buffer shouldn't get reused when removing nested data
3--FILE--
4<?php
5$s = <<<'STR'
6O:8:"stdClass":2:{i:5;C:8:"SplStack":29:{i:4;:r:1;:O:8:"stdClass":0:{}}i:0;O:13:"RegexIterator":1:{i:5;C:8:"SplStack":29:{i:4;:r:1;:O:8:"stdClass":0:{}}}}
7STR;
8var_dump(unserialize($s));
9gc_collect_cycles();
10?>
11--EXPECTF--
12Deprecated: Creation of dynamic property RegexIterator::$5 is deprecated in %s on line %d
13object(stdClass)#1 (2) {
14  ["5"]=>
15  object(SplStack)#2 (2) {
16    ["flags":"SplDoublyLinkedList":private]=>
17    int(4)
18    ["dllist":"SplDoublyLinkedList":private]=>
19    array(2) {
20      [0]=>
21      *RECURSION*
22      [1]=>
23      object(stdClass)#3 (0) {
24      }
25    }
26  }
27  ["0"]=>
28  object(RegexIterator)#4 (2) {
29    ["replacement"]=>
30    NULL
31    ["5"]=>
32    object(SplStack)#5 (2) {
33      ["flags":"SplDoublyLinkedList":private]=>
34      int(4)
35      ["dllist":"SplDoublyLinkedList":private]=>
36      array(2) {
37        [0]=>
38        *RECURSION*
39        [1]=>
40        object(stdClass)#6 (0) {
41        }
42      }
43    }
44  }
45}
46