3v4l.org

run code in 300+ PHP versions simultaneously
<?php register_shutdown_function(function() { echo "anyway, hello world\n"; }); set_error_handler(function($severity, $message, $file, $line) { throw new ErrorException($message, 0, $severity, $file, $line); }); set_exception_handler(function($exception) { echo $exception->getMessage().PHP_EOL; }); abstract class A { abstract public function meth(); } class B extends A { protected function meth() { } }
Output for 7.4.0 - 7.4.11
Fatal error: Access level to B::meth() must be public (as in class A) in /in/jPpIU on line 20
Process exited with code 255.
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.23
Fatal error: Access level to B::meth() must be public (as in class A) in /in/jPpIU on line 23
Process exited with code 255.

preferences:
151.69 ms | 997 KiB | 7 Q