--TEST-- Lazy objects: clone is independant of the original object --FILE-- initializeLazyObject($obj); $reflector->getProperty('foo')->setRawValueWithoutLazyInitialization($clonedObj, 'Y'); $reflector->initializeLazyObject($clonedObj); var_dump($clonedObj->foo); } $reflector = new ReflectionClass(SomeObj::class); test('Ghost', $reflector->newLazyGhost(function ($obj) { })); test('Proxy', $reflector->newLazyProxy(function () { return new SomeObj(); })); ?> --EXPECT-- # Ghost: string(1) "Y" # Proxy: string(1) "Y"