1--TEST--
2Test serialize() & unserialize() functions: objects - ensure that COW references of objects are not serialized separately (unlike other types).
3--FILE--
4<?php
5$x = new stdClass;
6$ref = &$x;
7var_dump(serialize(array($x, $x)));
8
9$x = 1;
10$ref = &$x;
11var_dump(serialize(array($x, $x)));
12
13$x = "a";
14$ref = &$x;
15var_dump(serialize(array($x, $x)));
16
17$x = true;
18$ref = &$x;
19var_dump(serialize(array($x, $x)));
20
21$x = null;
22$ref = &$x;
23var_dump(serialize(array($x, $x)));
24
25$x = array();
26$ref = &$x;
27var_dump(serialize(array($x, $x)));
28
29echo "Done";
30?>
31--EXPECT--
32string(37) "a:2:{i:0;O:8:"stdClass":0:{}i:1;r:2;}"
33string(22) "a:2:{i:0;i:1;i:1;i:1;}"
34string(30) "a:2:{i:0;s:1:"a";i:1;s:1:"a";}"
35string(22) "a:2:{i:0;b:1;i:1;b:1;}"
36string(18) "a:2:{i:0;N;i:1;N;}"
37string(26) "a:2:{i:0;a:0:{}i:1;a:0:{}}"
38Done
39