xref: /PHP-7.4/Zend/tests/traits/bug76773.phpt (revision d679f022)
1--TEST--
2Bug #76773 (Traits used on the parent are ignored for child classes)
3--FILE--
4<?php
5
6trait MyTrait
7{
8    public function hello()
9    {
10        echo __CLASS__, "\n";
11
12        if (\is_callable(array('parent', __FUNCTION__))) {
13            parent::hello();
14        }
15    }
16}
17
18class ParentClass
19{
20    use MyTrait;
21}
22
23class ChildClass extends ParentClass
24{
25    use MyTrait;
26}
27
28$c = new ChildClass();
29$c->hello();
30--EXPECT--
31ChildClass
32ParentClass
33