|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-06 15:03 UTC] jbernier at dalcom-intl dot com
[2003-01-06 21:03 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 10:00:01 2025 UTC |
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