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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 19:01:29 2024 UTC