1--TEST--
2Bug #62836 (Seg fault or broken object references on unserialize())
3--FILE--
4<?php
5$serialized_object='O:1:"A":4:{s:1:"b";O:1:"B":0:{}s:2:"b1";r:2;s:1:"c";O:1:"B":0:{}s:2:"c1";r:4;}';
6
7ini_set('unserialize_callback_func','mycallback');
8
9function mycallback($classname) {
10    unserialize("i:4;");
11    eval ("#[AllowDynamicProperties] class $classname {} ");
12}
13
14print_r(unserialize($serialized_object));
15echo "okey";
16?>
17--EXPECT--
18A Object
19(
20    [b] => B Object
21        (
22        )
23
24    [b1] => B Object
25        (
26        )
27
28    [c] => B Object
29        (
30        )
31
32    [c1] => B Object
33        (
34        )
35
36)
37okey
38