bug53727.phpt 572 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
  3. --FILE--
  4. <?php
  5. interface MyInterface {
  6. const TEST_CONSTANT = true;
  7. }
  8. class ParentClass implements MyInterface { }
  9. class ChildClass extends ParentClass { }
  10. echo (is_subclass_of('ChildClass', 'MyInterface') ? 'true' : 'false') . "\n";
  11. echo (defined('ChildClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
  12. echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n";
  13. echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
  14. --EXPECT--
  15. true
  16. true
  17. true
  18. true