3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait T { protected abstract function foo(); public function bar() { return $this->foo() * 100; } } class A { use T; //protected function foo() { return 42; } } $a = new A(); var_dump($a->bar());
based on WeTq5
Output for 7.0.0 - 7.2.0
Fatal error: Class A contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (A::foo) in /in/ksFcq on line 10
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Class A contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (A::foo) in /in/ksFcq on line 13
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/ksFcq on line 2
Process exited with code 255.