xref: /PHP-8.4/Zend/tests/traits/bug64070.phpt (revision 42437dd8)
1--TEST--
2Bug #64070 (Inheritance with Traits failed with error)
3--FILE--
4<?php
5trait first_trait
6{
7    function first_function()
8    {
9        echo "From First Trait\n";
10    }
11}
12
13trait second_trait
14{
15    use first_trait {
16        first_trait::first_function as second_function;
17    }
18
19    function first_function()
20    {
21        echo "From Second Trait\n";
22    }
23}
24
25class first_class
26{
27    use second_trait;
28}
29
30$obj = new first_class();
31$obj->first_function();
32$obj->second_function();
33?>
34--EXPECT--
35From Second Trait
36From First Trait
37