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

        if (is_resource($contents) === false) {

            throw new InvalidStreamProvided(

                "Invalid stream provided, expected stream resource, received " . gettype($contents)

            );

        } elseif ($type = get_resource_type($contents) !== 'stream') {

            throw new InvalidStreamProvided(
<?php     public static function becauseTheKeyIsNotValid($key): UnableToMountFilesystem

    {

        return new UnableToMountFilesystem(

            'Unable to mount filesystem, key was invalid. String expected, received: ' . gettype($key)

        );

    }
<?php     public static function becauseTheFilesystemWasNotValid($filesystem): UnableToMountFilesystem

    {

        $received = is_object($filesystem) ? get_class($filesystem) : gettype($filesystem);



        return new UnableToMountFilesystem(

            'Unable to mount filesystem, filesystem was invalid. Instance of ' . FilesystemOperator::class . ' expected, received: ' . $received