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
- Host: GitHub
- URL: https://github.com/arokettu/is-resource
- Owner: arokettu
- License: mit
- Created: 2021-09-23T20:58:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T14:34:07.000Z (over 1 year ago)
- Last Synced: 2025-04-11T02:17:53.818Z (about 1 year ago)
- Topics: compatibility, php, php80, php81, resources
- Language: PHP
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# IsResource: PHP Resource Compatibility Helper
[](https://packagist.org/packages/arokettu/is-resource)
[](https://packagist.org/packages/arokettu/is-resource)
[](https://opensource.org/licenses/MIT)
[](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