xref: /PHP-5.5/Zend/tests/bug53727.phpt (revision 34b8924f)
1--TEST--
2Bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
3--FILE--
4<?php
5interface MyInterface {
6    const TEST_CONSTANT = true;
7}
8
9class ParentClass implements MyInterface { }
10
11class ChildClass extends ParentClass { }
12
13echo (is_subclass_of('ChildClass', 'MyInterface') ? 'true' : 'false') . "\n";
14echo (defined('ChildClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
15
16echo (is_subclass_of('ParentClass', 'MyInterface') ? 'true' : 'false') . "\n";
17echo (defined('ParentClass::TEST_CONSTANT') ? 'true' : 'false') . "\n";
18--EXPECT--
19true
20true
21true
22true
23