3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* * @link https://github.com/php/php-src/issues/19509 */ ini_set("ignore_repeated_errors", 1); // Suppress repeated identical errors ini_set('error_reporting', 15); // Report errors, warnings & notices (value 15) set_error_handler('discard', ~error_reporting()); // Handler masks reportable errors for($i=0; $i<10; $i++ ) { trim($at); // This will only log one "undefined variable" notice or warning } function discard() { return true; // Handler consumes the error }

preferences:
22.77 ms | 476 KiB | 4 Q