No description
  • PHP 99.5%
  • Shell 0.5%
Find a file
2025-09-06 17:25:35 +03:00
data Add license declaration 2025-09-06 17:25:35 +03:00
docs Move to Codeberg 2025-08-15 19:12:43 +03:00
gen Add license declaration 2025-09-06 17:25:35 +03:00
sbin Add license declaration 2025-09-06 17:25:35 +03:00
src Add license declaration 2025-09-06 17:25:35 +03:00
tests Add license declaration 2025-09-06 17:25:35 +03:00
.gitattributes Update from templates 2023-09-04 14:09:36 +03:00
.gitignore SOAP declaration 2024-07-13 00:02:11 +03:00
.gitlab-ci.yml Drop tests for 7.1 and 7.2, test in 8.3 and 8.4 2025-08-15 20:05:00 +03:00
.readthedocs.yaml Update from the templates 2024-10-11 17:33:48 +03:00
CHANGELOG.md Changelog for 1.0.5 2025-08-15 19:09:36 +03:00
composer.json Allow 8.5 2025-08-15 19:09:36 +03:00
LICENSE.md README and LICENSE 2021-09-23 23:49:25 +03:00
README.md Installation first 2024-07-28 14:00:58 +03:00

IsResource: PHP Resource Compatibility Helper

Packagist PHP Packagist Gitlab pipeline status

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

Installation

composer require arokettu/is-resource

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"

Documentation

Read full documentation here: https://sandfox.dev/php/is-resource.html

Also on Read the Docs: https://is-resource.readthedocs.io/

Support

Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/is-resource/-/issues

Feel free to ask any questions in our room on Gitter: https://gitter.im/arokettu/community

License

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