note 51810 added to function.imagecreatetruecolor

From: Date: Mon, 11 Apr 2005 21:29:19 +0000
Subject: note 51810 added to function.imagecreatetruecolor
Groups: php.notes 
Request: Send a blank email to php-notes+get-87863@lists.php.net to get a copy of this message
Using function_exists() doesn't always work. Consider the following: echo "a:", function_exists(imagecreate),"<br>"; echo "b:", function_exists(imagecreatetruecolor),"<br>"; echo "c:", function_exists(imagecreatetruecolorrrr),"<br>"; echo phpinfo(8); This produces the output: a: 1 b: 1 c: <snip> gd GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with freetype JPG Support enabled PNG Support enabled WBMP Support enabled When I call imagecreatetruecolor(), I get: Warning: imagecreatetruecolor(): requires GD 2.0 or later in /home/gregt/public_html/gd/gdtest.php on line 8 Obviously I don't have a proper implementation of the imagecreatetruecolor function, but there is still code there to throw an error, so function_exists blindly assumes the function is present. ---- Manual Page -- http://www.php.net/manual/en/function.imagecreatetruecolor.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51810 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51810&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51810&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51810&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51810&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51810&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51810&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#87863) next »