1--TEST--
2Bug #62373 (serialize() generates wrong reference to the object)
3--FILE--
4<?php
5class A {}
6class B {}
7
8$size_of_ce = (((int)(log(PHP_INT_MAX) / log(2)) + 1 == 32 ? 368: 680) + 15) & ~15;
9$dummy = array();
10$b = new B();
11$period = $size_of_ce << 5;
12for ($i = 0; $i < $period * 3; $i++) {
13    $a = new A();
14    $s = unserialize(serialize(array($b, $a)));
15    if ($s[0] === $s[1]) {
16        echo "OOPS\n";
17        break;
18    }
19    $dummy[] = $a;
20}
21
22echo "OK\n";
23?>
24--EXPECT--
25OK
26