Use `get_resource_type` to match against wanted name. Ref: https://www.php.net/manual/en/language.types.resource.php Ref: https://www.php.net/manual/en/resource.php Ref: https://www.php.net/manual/en/function.get-resource-type.php