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