Annotation of embedaddon/php/Zend/tests/traits/conflict002.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Overwridden methods do not cause a conflict.
3: --FILE--
4: <?php
5: error_reporting(E_ALL);
6:
7: trait HelloWorld {
8: public function sayHello() {
9: echo 'Hello World!';
10: }
11: }
12:
13: trait HelloWorld2 {
14: public function sayHello() {
15: echo 'Hello World2!';
16: }
17: }
18:
19:
20: class TheWorldIsNotEnough {
21: use HelloWorld;
22: use HelloWorld2;
23: public function sayHello() {
24: echo 'Hello Universe!';
25: }
26: }
27:
28: $o = new TheWorldIsNotEnough();
29: $o->sayHello(); // echos Hello Universe!
30: ?>
31: --EXPECTF--
32: Hello Universe!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>