3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Log { public static function enableHandler() { set_exception_handler(['Log', '_handleException']); } protected static function _handleException(Throwable $exception) { } } Log::enableHandler(); throw Exception();
Output for 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
Fatal error: Invalid callback Log::_handleException, cannot access protected method Log::_handleException() in Unknown on line 0
Process exited with code 255.
Output for 7.1.26 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30
Warning: Invalid callback Log::_handleException, cannot access protected method Log::_handleException() in Unknown on line 0 Fatal error: Uncaught Error: Call to undefined function Exception() in /in/Jm9SX:14 Stack trace: #0 {main} thrown in /in/Jm9SX on line 14
Process exited with code 255.

preferences:
82.61 ms | 408 KiB | 5 Q