PHP code example of arokettu / is-resource
1. Go to this page and download the library: Download arokettu/is-resource library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arokettu / is-resource example snippets
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"