Edit report at http://bugs.php.net/bug.php?id=51570&edit=1
ID: 51570 Updated by: fel...@php.net Reported by: ealexs at gmail dot com Summary: is_subclass_of fails to autoload the classes -Status: Open +Status: Feedback Type: Bug Package: Reproducible crash Operating System: Debian PHP Version: 5.2.13 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2010-04-16 15:56:25] ealexs at gmail dot com Description: ------------ is_subclass_of fails to autoload the classes causing PHP do die and apache returns an empty page. NO error is triggered ! It was very hard to find the cause My php config it's here: http://alex.softdev.ro/info.php Failing function: function ClassIsA($object_class, $class) { if ($object_class == $class) return true; return (is_subclass_of($object_class, $class)); } If changed it works: function ClassIsA($object_class, $class) { // use this to force the load of the classes if (!class_exists($object_class)) throw new Exception("Class $object_class not found"); // use this to force the load of the classes if (!class_exists($class)) throw new Exception("Class $class not found"); if ($object_class == $class) return true; return (is_subclass_of($object_class, $class)); } looks like calling class_exists calls autoload and works fine Thanks, Alex Test script: --------------- Failing function: function ClassIsA($object_class, $class) { if ($object_class == $class) return true; return (is_subclass_of($object_class, $class)); } If changed it works: function ClassIsA($object_class, $class) { // use this to force the load of the classes if (!class_exists($object_class)) throw new Exception("Class $object_class not found"); // use this to force the load of the classes if (!class_exists($class)) throw new Exception("Class $class not found"); if ($object_class == $class) return true; return (is_subclass_of($object_class, $class)); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51570&edit=1