xref: /PHP-8.1/Zend/tests/traits/bug64235b.phpt (revision 9a44a980)
1--TEST--
2Bug #64235 (Insteadof not work for class method in 5.4.11)
3--FILE--
4<?php
5
6class TestParentClass
7{
8    public function method()
9    {
10        print_r('Parent method');
11        print "\n";
12    }
13}
14
15trait TestTrait
16{
17    public function method()
18    {
19        print_r('Trait method');
20        print "\n";
21    }
22}
23
24class TestChildClass extends TestParentClass
25{
26    use TestTrait
27    {
28        TestTrait::method as methodAlias;
29        TestParentClass::method as TestParent;
30    }
31}
32
33?>
34--EXPECTF--
35Fatal error: Class TestParentClass is not a trait, Only traits may be used in 'as' and 'insteadof' statements in %sbug64235b.php on line %d
36