3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait FooTrait { abstract public function flashMessage($message); public function successMessage() { $this->flashMessage('foo'); } } class BarPresenter { /*public function flashMessage($message) { var_dump($message); }*/ } class FooPresenter extends BarPresenter { use FooTrait; } $foo = new FooPresenter(); $foo->successMessage();
based on Tu9IM
Output for 7.0.0 - 7.2.0
Fatal error: Class FooPresenter contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (FooPresenter::flashMessage) in /in/cVU4a on line 25
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Class FooPresenter contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (FooPresenter::flashMessage) in /in/cVU4a on line 30
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/cVU4a on line 3
Process exited with code 255.