1--TEST--
2Lazy objects: RFC example 007
3--FILE--
4<?php
5
6class MyClass {
7    public $a;
8}
9
10$object = new MyClass();
11$ref = WeakReference::create($object);
12$id = spl_object_id($object);
13
14$reflector = new ReflectionClass(MyClass::class);
15
16$reflector->resetAsLazyGhost($object, function () {});
17var_dump($id === spl_object_id($object));
18var_dump($ref->get() === $object);
19
20$reflector->initializeLazyObject($object);
21var_dump($id === spl_object_id($object));
22var_dump($ref->get() === $object);
23
24?>
25==DONE==
26--EXPECT--
27bool(true)
28bool(true)
29bool(true)
30bool(true)
31==DONE==
32