unread
Hello,
I have attached a patch to the following bug, but I believe the bug is incorrect...
If is_subclass_of()
is used in conjunction with a interface it should always return false because it's not a class, it's an interface.
Test:
interface MyInterface {
const TEST_CONSTANT = true;
}
class ParentClass implements MyInterface { }
class ChildClass extends ParentClass { }
echo (is_subclass_of('ChildClass', 'MyInterface') ? 'true' : 'false') . "\n";
echo (defined('ChildClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n";
echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
Expected result:
false
true
false
true
Actual result:
true
true
false
true