summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/language010.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/traits/language010.phpt')
-rw-r--r--Zend/tests/traits/language010.phpt30
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/tests/traits/language010.phpt b/Zend/tests/traits/language010.phpt
new file mode 100644
index 0000000..e550abb
--- /dev/null
+++ b/Zend/tests/traits/language010.phpt
@@ -0,0 +1,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 has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d \ No newline at end of file