summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug76773.phpt
blob: 4ab53bf6d11d20e361c90a43767d5a0b5d288b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
Bug #76773 (Traits used on the parent are ignored for child classes)
--FILE--
<?php

trait MyTrait
{
    public function hello()
    {
        echo __CLASS__, "\n";

        if (\is_callable(array('parent', __FUNCTION__))) {
            parent::hello();
        }
    }
}

class ParentClass
{
    use MyTrait;
}

class ChildClass extends ParentClass
{
    use MyTrait;
}

$c = new ChildClass();
$c->hello();
?>
--EXPECT--
ChildClass
ParentClass