You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
6 months ago | |
---|---|---|
data | 2 years ago | |
docs | 2 years ago | |
gen | 2 years ago | |
sbin | 2 years ago | |
src | 2 years ago | |
tests | 2 years ago | |
.gitattributes | 9 months ago | |
.gitignore | 2 years ago | |
.gitlab-ci.yml | 6 months ago | |
CHANGELOG.md | 9 months ago | |
LICENSE.md | 2 years ago | |
README.md | 2 years ago | |
composer.json | 9 months ago |
README.md
IsResource: PHP Resource Compatibility Helper
is_resource()
and get_resource_type()
that work with opaque objects.
Usage
<?php
use Arokettu\IsResource as r;
$hash = hash_init('md5');
// vanilla functions:
is_resource($hash); // true in PHP <= 7.1, false in 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"
Installation
composer require arokettu/is-resource
Documentation
Read full documentation here: https://sandfox.dev/php/is-resource.html
Also on Read the Docs: https://is-resource.readthedocs.io/
License
The library is available as open source under the terms of the MIT License.