php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79746 Gd create a image resource, but `is_resource` reutrn false,
Submitted: 2020-06-27 03:11 UTC Modified: 2020-06-27 07:56 UTC
From: re2953 at 163 dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 8.0.0alpha1 OS: osx 10.15
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: re2953 at 163 dot com
New email:
PHP Version: OS:

 

 [2020-06-27 03:11 UTC] re2953 at 163 dot com
Description:
------------
Gd create a image resource, but `is_resource` reutrn false, and `gettype` return 'object'.It breaks the compatibility.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-06-27 07:11 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2020-06-27 07:11 UTC] requinix@php.net
Yes, for the people who test for resource types this is a BC break. That's why it's happening in 8.0 and not 7.x.
 [2020-06-27 07:56 UTC] nikic@php.net
To clarify, rather than checking is_resource($gd), it is preferred to check $gd !== false (for functions that can return a resource or false), as this will work in PHP 7 and PHP 8.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 22:01:30 2025 UTC