xref: /PHP-7.1/ext/spl/tests/array_025.phpt (revision f0cf9b4c)
1--TEST--
2SPL: ArrayObject serialize with an object as storage
3--FILE--
4<?php
5$obj1 = new ArrayObject(new ArrayObject(array(1,2)));
6$s = serialize($obj1);
7$obj2 = unserialize($s);
8
9print_r($obj1);
10echo "$s\n";
11print_r($obj2);
12?>
13--EXPECT--
14ArrayObject Object
15(
16    [storage:ArrayObject:private] => ArrayObject Object
17        (
18            [storage:ArrayObject:private] => Array
19                (
20                    [0] => 1
21                    [1] => 2
22                )
23
24        )
25
26)
27C:11:"ArrayObject":76:{x:i:0;C:11:"ArrayObject":37:{x:i:0;a:2:{i:0;i:1;i:1;i:2;};m:a:0:{}};m:a:0:{}}
28ArrayObject Object
29(
30    [storage:ArrayObject:private] => ArrayObject Object
31        (
32            [storage:ArrayObject:private] => Array
33                (
34                    [0] => 1
35                    [1] => 2
36                )
37
38        )
39
40)
41