--- /dev/null
+--TEST--
+Trying to use instanceof for a method twice
+--FILE--
+<?php
+
+trait foo {
+ public function foo() {
+ return 1;
+ }
+}
+
+trait foo2 {
+ public function foo() {
+ return 2;
+ }
+}
+
+
+class A extends foo {
+ use foo {
+ foo2::foo insteadof foo;
+ foo2::foo insteadof foo;
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Class A cannot extend from trait foo in %s on line %d
--- /dev/null
+--TEST--
+Trying to use an undefined trait
+--FILE--
+<?php
+
+class A {
+ use abc;
+}
+
+?>
+--EXPECTF--
+Fatal error: Trait 'abc' not found in %s on line %d
--- /dev/null
+--TEST--
+Trying to use an interface as trait
+--FILE--
+<?php
+
+interface abc {
+}
+
+class A {
+ use abc;
+}
+
+?>
+--EXPECTF--
+Fatal error: A cannot use abc - it is not a trait in %s on line %d
--- /dev/null
+--TEST--
+Trying to use a class as trait
+--FILE--
+<?php
+
+class abc {
+}
+
+class A {
+ use abc;
+}
+
+?>
+--EXPECTF--
+Fatal error: A cannot use abc - it is not a trait in %s on line %d
--- /dev/null
+--TEST--
+Trying to use a final class as trait
+--FILE--
+<?php
+
+final class abc {
+}
+
+class A {
+ use abc;
+}
+
+?>
+--EXPECTF--
+Fatal error: A cannot use abc - it is not a trait in %s on line %d
--- /dev/null
+--TEST--
+Trying to use an abstract class as trait
+--FILE--
+<?php
+
+abstract class abc {
+}
+
+class A {
+ use abc;
+}
+
+?>
+--EXPECTF--
+Fatal error: A cannot use abc - it is not a trait in %s on line %d
--- /dev/null
+--TEST--
+Trying to instantiate a trait
+--FILE--
+<?php
+
+trait abc {
+}
+
+new abc;
+
+?>
+--EXPECTF--
+Fatal error: Cannot instantiate trait abc in %s on line %d
--- /dev/null
+--TEST--
+Trying to implement a trait
+--FILE--
+<?php
+
+trait abc { }
+
+class foo implements abc { }
+
+?>
+--EXPECTF--
+Fatal error: foo cannot implement abc - it is not an interface in %s on line %d
--- /dev/null
+--TEST--
+Trying to extend a trait
+--FILE--
+<?php
+
+trait abc { }
+
+class foo extends abc { }
+
+?>
+--EXPECTF--
+Fatal error: Class foo cannot extend from trait abc in %s on line %d