An open API service indexing awesome lists of open source software.

https://github.com/arokettu/is-resource

Future compatible is_resource() and get_resource_type() that can understand opaque objects
https://github.com/arokettu/is-resource

compatibility php php80 php81 resources

Last synced: 4 months ago
JSON representation

Future compatible is_resource() and get_resource_type() that can understand opaque objects

Awesome Lists containing this project

README

          

# IsResource: PHP Resource Compatibility Helper

[![Packagist](https://img.shields.io/packagist/v/arokettu/is-resource.svg?style=flat-square)](https://packagist.org/packages/arokettu/is-resource)
[![PHP](https://img.shields.io/packagist/php-v/arokettu/is-resource.svg?style=flat-square)](https://packagist.org/packages/arokettu/is-resource)
[![Packagist](https://img.shields.io/github/license/arokettu/is-resource.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Gitlab pipeline status](https://img.shields.io/gitlab/pipeline/sandfox/is-resource/master.svg?style=flat-square)](https://gitlab.com/sandfox/is-resource/-/pipelines)

``is_resource()`` and ``get_resource_type()`` that can understand objects that replaced earlier resources.

## Installation

```bash
composer require arokettu/is-resource
```

## Usage

```php
= 7.2
get_resource_type($hash); // "Hash Context" in PHP <= 7.1, null or TypeError in PHP >= 7.2

// library functions:
r\is_resource($hash); // true
r\get_resource_type($hash); // "Hash Context"
```

## Documentation

Read full documentation here:

Also on Read the Docs:

## Support

Please file issues on our main repo at GitLab:

Feel free to ask any questions in our room on Gitter:

## License

The library is available as open source under the terms of the [MIT License].

[MIT License]: https://opensource.org/licenses/MIT