ID:               34157
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jami dot pekkanen at ateco dot fi
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Linux
 PHP Version:      5.0.4
 New Comment:

Actually it has nothing to do with methods, abstract etc.

You get the result you get because 'BrokenImplementor' doesn't have
parent classes at all, so it can't be a "subclass" of another
class/interface.
But 'WorkingImplementor' is a subclass of class that implements the
interface, so it works in this case.

Anyway, you should use 'instanceof' operator instead - it'd work in
both cases, as it operates differently.


Previous Comments:
------------------------------------------------------------------------

[2005-08-16 21:07:58] jami dot pekkanen at ateco dot fi

Description:
------------
If interface contains abstract method, direct implementor isn't
reported as subclass of the interface. However, if one has abstract
class in the inheritance hierarchy, implementing classes are reported
as subclasses of the interface.

Should abstract methods in interfaces even exist?

Reproduce code:
---------------
<?php
interface SomeInterface
{
        abstract public function Foo();
}

class BrokenImplementor implements SomeInterface
{
        public function Foo() {}
}

abstract class DummyParent implements SomeInterface {}
class WorkingImplementor extends DummyParent
{
        public function Foo() {}
}

var_dump(is_subclass_of('WorkingImplementor', 'SomeInterface'));
var_dump(is_subclass_of('BrokenImplementor', 'SomeInterface'));
?>

Expected result:
----------------
bool(true)
bool(true)

Actual result:
--------------
bool(true)
bool(false)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34157&edit=1

Reply via email to