ID: 21462 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux Slackware PHP Version: 4.3.0 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php You cannot 'capture' fatal errors, your approach to checking function avaliablity is flawed. Instead of trying to execute the function, why not use function_exists(), which will accurately tell you if a function is avaliable or not. Previous Comments: ------------------------------------------------------------------------ [2003-01-06 15:03:02] [EMAIL PROTECTED] I am also experimenting this. My function used as error handling now gives me array in all the parameters. Ex. : function my_error_handler($errno,$errstr,$errfile,$errline,$variables) $errno = array $errstr = array etc... ------------------------------------------------------------------------ [2003-01-06 09:01:50] [EMAIL PROTECTED] Today we upgraded from php 4.2.3 (apache 1.3.26) to php 4.3.0. We use freetype functionality in a set of functions and to keep this very flexible the following code (except for the debugging prints) is used to determine what freetype version was installed in order to use the right functions (imagefttext or imagettftext). This function (the set_error_handler) stopped working properly after upgrading to 4.3.0 print freetype_version(); function freetype_version() { // change error handler set_error_handler("freetype_version_handler"); // remove freetype version from session unset($_SESSION['freetype_version']); // determine check array $checkers = array( "imagefttext" => 2, // freetype version specific function -> freetype version "imagettftext" => 1 ); // run checkers while (list($key,$val)=each($checkers)) { printf("%s:%s<br>\n",$key,$val); eval(sprintf("%s();",$key)); } // restore old error handler restore_error_handler(); // return version (null = no freetype support) return $_SESSION['freetype_version']; } function freetype_version_handler($errno,$errstr,$errfile,$errline,$variables) { print "errorrr!<br>\n"; if (eregi(sprintf("wrong parameter count for %s",$variables['key']),$errstr)) { $_SESSION['freetype_version'] = $variables['val']; } } The code outputs the following error: Fatal error: Call to undefined function: imagefttext() in /sda6/domains/betterbeyourself.com_staging/includes/fnc_lang.inc(651) : eval()'d code on line 1 We allready use a custom error handler so the above handler is nested... this however worked very well in 4.2.3 I also noticed the same problems in some 4.3.0 developmental cvs snapshots (don't know which snapshots they were though) and thought it was a bug to be solved before the stable release but appearantly it's still there.... Grtz, Jeroen ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21462&edit=1
