3v4l.org

run code in 300+ PHP versions simultaneously
<?php function log_error( $type, $message, $file, $line ) { $error_reporting = error_reporting(); echo $error_reporting . ' - ' . ( $error_reporting & $type ) . PHP_EOL; } set_error_handler( 'log_error' ); trigger_error( 'A', E_USER_NOTICE ); @trigger_error( 'A', E_USER_NOTICE ); $constants = ['E_ERROR', 'E_USER_ERROR', 'E_USER_WARNING', 'E_USER_NOTICE', 'E_DEPRECATED', 'E_USER_DEPRECATED', 'E_RECOVERABLE_ERROR', 'E_ALL']; foreach ( $constants as $constant ) { echo $constant . ': ' . constant( $constant ) . PHP_EOL; error_reporting( constant( $constant ) ); trigger_error( 'A', E_USER_NOTICE ); @trigger_error( 'A', E_USER_NOTICE ); }

preferences:
30.28 ms | 407 KiB | 5 Q