Annotation of embedaddon/php/Zend/tests/traits/language005.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Use instead to solve a conflict and as to access the method.
3: --FILE--
4: <?php
5: error_reporting(E_ALL);
6:
7: trait A {
8: public function smallTalk() {
9: echo 'a';
10: }
11: public function bigTalk() {
12: echo 'A';
13: }
14: }
15:
16: trait B {
17: public function smallTalk() {
18: echo 'b';
19: }
20: public function bigTalk() {
21: echo 'B';
22: }
23: }
24:
25: class Talker {
26: use A, B {
27: B::smallTalk insteadof A;
28: A::bigTalk insteadof B;
29: B::bigTalk as talk;
30: }
31: }
32:
33: $t = new Talker;
34: $t->smallTalk();
35: $t->bigTalk();
36: $t->talk();
37:
38: ?>
39: --EXPECTF--
40: bAB
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>