public static function prepare($values,
$objectsPool, &
$refsPool, &
$objectsCount, &
$valuesAreStatic) { $refs =
$values;
foreach ($values as $k =>
$value) { if (\
is_resource($value)) { throw new NotInstantiableTypeException(get_resource_type($value).' resource'
);
} $refs[$k] =
$objectsPool;
if ($isRef = !
$valueIsStatic =
$values[$k] !==
$objectsPool) { $values[$k] = &
$value; // Break hard references to make $values completely
unset($value); // independent from the original structure
$refs[$k] =
$value =
$values[$k];
if ($value instanceof Reference && 0 >
$value->id
) { $valuesAreStatic = false;
++
$value->count;
continue;
}