Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get the type of a variable
<?php gettype(mixed $value): string
<?php             sprintf(

                "Option 'platform' must be an object and subtype of '%s'. Got '%s'",

                AbstractPlatform::class,

                gettype($invalidPlatform)

            )

        );

    }
<?php         return new self(sprintf(

            'Could not convert PHP value of type %s to type %s. Expected one of the following types: %s',

            is_object($value) ? get_class($value) : gettype($value),

            $toType,

            implode(', ', $possibleTypes)

        ), 0, $previous);
<?php     public static function conversionFailedSerialization($value, $format, $error)

    {

        $actualType = is_object($value) ? get_class($value) : gettype($value);



        return new self(sprintf(

            "Could not convert PHP type '%s' to '%s', as an '%s' error was triggered by the serialization",