diff --git a/src/Serializer.php b/src/Serializer.php index b84055f..d8ff6da 100644 --- a/src/Serializer.php +++ b/src/Serializer.php @@ -126,7 +126,7 @@ private function process( private function processObject(object $haystack, int $level, array $trackedInstanceHashes = []): array { $values = []; - if (!$haystack instanceof \stdClass && class_exists(get_class($haystack))) { + if (!$haystack instanceof \stdClass && class_exists($haystack::class)) { $ref = new \ReflectionClass($haystack); foreach ($ref->getProperties() as $property) { $property->setAccessible(true);