ID: 32690 Updated by: [EMAIL PROTECTED] Reported By: gregt at maths dot otago dot ac dot nz -Status: Assigned +Status: Bogus Bug Type: GD related Operating System: Linux -PHP Version: 4.3.9 +PHP Version: 4.2.3 Assigned To: pajoye New Comment:
This was fixed loooong ago - do not lie about version numbers, you just wasted 15 minutes of my time. Previous Comments: ------------------------------------------------------------------------ [2005-04-13 09:16:46] [EMAIL PROTECTED] Tony, you're wrong - if something doesn't work it should not be available. Assigning to you :) ------------------------------------------------------------------------ [2005-04-13 08:25:06] [EMAIL PROTECTED] This is expected behaviour. Use gd_info() to get the version of GD library you have. ------------------------------------------------------------------------ [2005-04-13 06:32:56] gregt at maths dot otago dot ac dot nz Description: ------------ When using function function_exists() to test for presence of a function, the result is sometimes wrong. 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. Reproduce code: --------------- <? echo "a:", function_exists(imagecreate),"<br>"; echo "b:", function_exists(imagecreatetruecolor),"<br>"; echo "c:", function_exists(imagecreatetruecolorrrr),"<br>"; echo phpinfo(8); ?> Expected result: ---------------- a: 1 b: c: Actual result: -------------- a: 1 b: 1 c: ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32690&edit=1