xref: /PHP-8.4/ext/spl/tests/bug78456.phpt (revision 9483c507)
1--TEST--
2Bug #78456: Segfault when serializing SplDoublyLinkedList
3--FILE--
4<?php
5
6$dllist = new SplDoublyLinkedList();
7$dllist->push(new stdClass);
8var_dump($s = serialize($dllist));
9var_dump(unserialize($s));
10
11?>
12--EXPECT--
13string(82) "O:19:"SplDoublyLinkedList":3:{i:0;i:0;i:1;a:1:{i:0;O:8:"stdClass":0:{}}i:2;a:0:{}}"
14object(SplDoublyLinkedList)#3 (2) {
15  ["flags":"SplDoublyLinkedList":private]=>
16  int(0)
17  ["dllist":"SplDoublyLinkedList":private]=>
18  array(1) {
19    [0]=>
20    object(stdClass)#4 (0) {
21    }
22  }
23}
24