3v4l.org

run code in 500+ PHP versions simultaneously
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL & ~E_USER_ERROR); set_error_handler(function (int $level, string $message) { $silenced = 0 === (error_reporting() & $level); echo "!> Error captured: {$message}" . PHP_EOL; echo " > Current error reporting: " . error_reporting() . PHP_EOL; echo " > Current Sentry check if error was silenced reports: " . ($silenced ? 'silenced' : 'NOT silenced') . PHP_EOL; echo PHP_EOL; return true; }); // This once should report as silenced @trigger_error('Silent Hello World', E_USER_ERROR); // This one should not report as silenced trigger_error('Hello World', E_USER_ERROR);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.33
!> Error captured: Silent Hello World > Current error reporting: 4181 > Current Sentry check if error was silenced reports: silenced !> Error captured: Hello World > Current error reporting: 32511 > Current Sentry check if error was silenced reports: silenced
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
!> Error captured: Silent Hello World > Current error reporting: 0 > Current Sentry check if error was silenced reports: silenced !> Error captured: Hello World > Current error reporting: 32511 > Current Sentry check if error was silenced reports: silenced
Output for 8.4.1 - 8.4.26, 8.5.0 - 8.5.9
!> Error captured: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead > Current error reporting: 4181 > Current Sentry check if error was silenced reports: silenced !> Error captured: Silent Hello World > Current error reporting: 4181 > Current Sentry check if error was silenced reports: silenced !> Error captured: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead > Current error reporting: 30463 > Current Sentry check if error was silenced reports: NOT silenced !> Error captured: Hello World > Current error reporting: 30463 > Current Sentry check if error was silenced reports: silenced

preferences:
40.96 ms | 1144 KiB | 12 Q