3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait FooTrait { public function doFoo() { $this->doBar(); } abstract function doBar(); } class Bar { use FooTrait; public function doBar() { var_dump('bar'); } } class Baz { use FooTrait; }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Class Baz contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Baz::doBar) in /in/F6W8K on line 27
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Class Baz contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Baz::doBar) in /in/F6W8K on line 32
Process exited with code 255.

preferences:
225.6 ms | 402 KiB | 194 Q