<?php
trait MyTrait {
public function traitFunction() {
return parent::otherFunction();
}
}
class MyClass {
public function foo() {
return 'bar';
}
public static function derp() {
return $this->foo();
}
}
MyClass::derp();
Fatal error: Uncaught Error: Using $this when not in object context in /in/a9Hd0:15
Stack trace:
#0 /in/a9Hd0(19): MyClass::derp()
#1 {main}
thrown in /in/a9Hd0 on line 15
Process exited with code 255.