get_resource_type

Supported Versions: PHP 4 >= 4.0.2, PHP 5, PHP 7, PHP 8
Returns the resource type
<?php get_resource_type(resource $resource): string
<?php             throw new InvalidStreamProvided(

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

            );

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

            throw new InvalidStreamProvided(

                "Invalid stream provided, expected stream resource, received resource of type " . $type

            );