summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/bug64235b.phpt
blob: a326ec02c33ccfa01b4e70c416febb2201316ada (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
--TEST--
Bug #64235 (Insteadof not work for class method in 5.4.11)
--FILE--
<?php

class TestParentClass
{
    public function method()
    {
        print_r('Parent method');
        print "\n";
    }
}

trait TestTrait
{
    public function method()
    {
        print_r('Trait method');
        print "\n";
    }
}

class TestChildClass extends TestParentClass
{
    use TestTrait
    {
        TestTrait::method as methodAlias;
        TestParentClass::method as TestParent;
    }
}

?>
--EXPECTF--
Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d