Edit report at https://bugs.php.net/bug.php?id=51570&edit=1

 ID:               51570
 Updated by:       php-bugs@lists.php.net
 Reported by:      ealexs at gmail dot com
 Summary:          is_subclass_of fails to autoload the classes
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          Reproducible crash
 Operating System: Debian
 PHP Version:      5.2.13

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2010-04-21 16:36:31] fel...@php.net

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.



------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=51570&edit=1

Reply via email to