summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug64070.phpt
blob: a5ee3b6a5fffd36feb8058f7b41dfbaee0079066 (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
34
35
36
--TEST--
Bug #64070 (Inheritance with Traits failed with error)
--FILE--
<?php
trait first_trait
{
    function first_function()
    {
        echo "From First Trait\n";
    }
}

trait second_trait
{
    use first_trait {
        first_trait::first_function as second_function;
    }

    function first_function()
    {
        echo "From Second Trait\n";
    }
}

class first_class
{
    use second_trait;
}

$obj = new first_class();
$obj->first_function();
$obj->second_function();
?>
--EXPECT--
From Second Trait
From First Trait