note 51810 rejected from function.imagecreatetruecolor by betz

From: Date: Tue, 12 Apr 2005 13:52:46 +0000
Subject: note 51810 rejected from function.imagecreatetruecolor by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-87906@lists.php.net to get a copy of this message
Note Submitter: gregt at maths dot otago dot ac dot nz ---- 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.

« previous php.notes (#87906) next »