3v4l.org

run code in 300+ PHP versions simultaneously
<?php convertPhpErrorsToExceptions(); $array = ['hi' => 'dsa']; echo $array['unknown']; function convertPhpErrorsToExceptions() { static $isNotLoaded = true; if ($isNotLoaded) { set_error_handler('phpErrorToException'); $isNotLoaded = false; } } function phpErrorToException($severity, $message, $filename, $lineno) { if (error_reporting() & $severity) { throw new \ErrorException($message, 0, $severity, $filename, $lineno); } }

preferences:
36.81 ms | 402 KiB | 5 Q