Doc #80640 [Opn]: imagecreatetruecolor returns GDimage object instead of resource

From: Date: Mon, 18 Jan 2021 11:48:18 +0000
Subject: Doc #80640 [Opn]: imagecreatetruecolor returns GDimage object instead of resource
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18419@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80640&edit=1

 ID:                 80640
 Updated by:         cmb@php.net
 Reported by:        petzold dot mx at gmail dot com
 Summary:            imagecreatetruecolor returns GDimage object instead
                     of resource
 Status:             Open
 Type:               Documentation Problem
-Package:            *Programming Data Structures
+Package:            GD related
 Operating System:   debian
 PHP Version:        8.0Git-2021-01-18 (snap)
 Block user comment: N
 Private report:     N

 New Comment:

Indeed, that is not documented in the manual proper; only the
migration guide notes the resource to object migration[1].

[1] <https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object>


Previous Comments:
------------------------------------------------------------------------
[2021-01-18 10:29:44] petzold dot mx at gmail dot com

Description:
------------
---
From manual page: https://php.net/function.imagecreatetruecolor
---
returntype Change with php8 is not mentioned

imagecreatetruecolor returns an GdImage Object instead of a resource


Test script:
---------------
$image = imagecreatetruecolor(10,10);

if (!is_resource($image)) { 
die('Unable to generate image: not a resource'); 
}

Expected result:
----------------
true

Actual result:
--------------
false


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80640&edit=1


Thread (5 messages)

« previous php.doc.bugs (#18419) next »