summaryrefslogtreecommitdiff
path: root/Zend/tests/traits/methods_002.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/traits/methods_002.phpt')
-rw-r--r--Zend/tests/traits/methods_002.phpt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Zend/tests/traits/methods_002.phpt b/Zend/tests/traits/methods_002.phpt
new file mode 100644
index 0000000..4ed64c1
--- /dev/null
+++ b/Zend/tests/traits/methods_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Testing collision with magic methods
+--FILE--
+<?php
+
+trait foo {
+ public function __clone() {
+ var_dump(__FUNCTION__);
+ }
+}
+
+trait baz {
+ public function __clone() {
+ var_dump(__FUNCTION__);
+ }
+}
+
+class bar {
+ use foo;
+ use baz;
+}
+
+$o = new bar;
+var_dump(clone $o);
+
+?>
+--EXPECTF--
+Fatal error: Trait method __clone has not been applied, because there are collisions with other trait methods on bar in %s on line %d