Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is a resource
is_resource(mixed $value): bool
    public function isGdResource()

    {

        if (
is_resource($this->data)) {

            return (
get_resource_type($this->data) == 'gd');

        }
    public function isStream()

    {

        if (
$this->data instanceof StreamInterface) return true;

        if (!
is_resource($this->data)) return false;

        if (
get_resource_type($this->data) !== 'stream') return false;



        return 
true;
    {

        
$backupName $this->argument(0)->value();



        if (
is_resource($backup $image->getBackup($backupName))) {




            
imagedestroy($image->getCore());