mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
7aacc705d0
Closes GH-5958
24 lines
575 B
PHP
24 lines
575 B
PHP
--TEST--
|
|
Bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
|
|
--FILE--
|
|
<?php
|
|
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";
|
|
?>
|
|
--EXPECT--
|
|
true
|
|
true
|
|
true
|
|
true
|