summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/language010.phpt
blob: a5e85d07963343c6669a59c1a6e12cd861fe2f1c (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
--TEST--
Aliasing leading to conflict should result in error message
--FILE--
<?php
error_reporting(E_ALL);

trait Hello {
   public function hello() {
     echo 'Hello';
   }
}

trait World {
   public function world() {
     echo ' World!';
   }
}


class MyClass {
   use Hello, World { hello as world; }
}

$o = new MyClass();
$o->hello();
$o->world();

?>
--EXPECTF--
Fatal error: Trait method World::world has not been applied as MyClass::world, because of collision with Hello::world in %s on line %d