[wp-trac] [WordPress Trac] #50833: [PHP 8] GD resources are GdImage object instances

WordPress Trac noreply at wordpress.org
Sun Aug 2 10:31:53 UTC 2020


#50833: [PHP 8] GD resources are GdImage object instances
--------------------------+------------------------------
 Reporter:  ayeshrajans   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  needs-patch php8
  Focuses:                |
--------------------------+------------------------------
 In PHP 8, GD extension uses `GdImage` class objects instead of resources.

 https://php.watch/versions/8.0/gdimage

 This is a preemptive ticket aiming WordPress 5.6.

  - Update `is_resource()` calls to accomodate `GdImage` instances as well
 (https://php.watch/versions/8.0/gdimage#gdimage-is-resource)
  - Update PHPDoc comments to allow `resource|GdImage` in their type hints.

 Without these changes, WordPress early-fails to process images because it
 is being defensive with multiple `is_resource()` checks which will no
 longer return `true` in PHP 8.0.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50833>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list