goto handle_value;
} $valueIsStatic = false;
if (isset($objectsPool[$value])) { ++
$objectsCount;
$value =
new Reference($objectsPool[$value][0
]);
goto handle_value;
} $class =
$value::
class;
$reflector = Registry::
$reflectors[$class] ??= Registry::
getClassReflector($class);
$properties =
[];
if ($reflector->
hasMethod('__serialize'
)) { if (!
$reflector->
getMethod('__serialize'
)->
isPublic()) { throw new \
Error(sprintf('Call to %s method "%s::__serialize()".',
$reflector->
getMethod('__serialize'
)->
isProtected() ? 'protected' : 'private',
$class));
} if (!\
is_array($serializeProperties =
$value->
__serialize())) { throw new \
TypeError($class.'::__serialize() must return an array'
);
}