3v4l.org

run code in 300+ PHP versions simultaneously
<?php function errorHandler($errno, $errstr, $errfile, $errline) { print_r(['This invoked custom error handler', $errno, $errstr, $errfile, $errline]); } function errorHandlerWithoutWarnings($errno, $errstr, $errfile, $errline) { print_r(['This invoked custom error handler errorHandlerWithoutWarnings', $errno, $errstr, $errfile, $errline]); } set_error_handler('errorHandler', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); $a = []; echo $a['fooo']; set_error_handler('errorHandlerWithoutWarnings', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING); $a = []; echo $a['fooo'];

preferences:
35.77 ms | 405 KiB | 5 Q