summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/conflict002.phpt
blob: 64712d40a4f616d04080cefc4f30305337769cd6 (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
--TEST--
Overwridden methods do not cause a conflict.
--FILE--
<?php
error_reporting(E_ALL);

trait HelloWorld {
   public function sayHello() {
     echo 'Hello World!';
   }
}

trait HelloWorld2 {
   public function sayHello() {
     echo 'Hello World2!';
   }
}


class TheWorldIsNotEnough {
   use HelloWorld;
   use HelloWorld2;
   public function sayHello() {
     echo 'Hello Universe!';
   }
}

$o = new TheWorldIsNotEnough();
$o->sayHello(); // echos Hello Universe!
?>
--EXPECTF--	
Hello Universe!