3v4l.org

run code in 300+ PHP versions simultaneously
<?php trigger_error('this is no problem - just a notice'); set_error_handler(function ($s, $m, $f, $l) { throw new ErrorException($m, 0, $s, $f, $l); }); echo "this will still work fine:"; @trigger_error('see? no problem'); echo "\nthis, however, will not:"; trigger_error('see? no problem');
Output for 8.0.0 - 8.0.3
Notice: this is no problem - just a notice in /in/222oU on line 3 this will still work fine: Fatal error: Uncaught ErrorException: see? no problem in /in/222oU:9 Stack trace: #0 [internal function]: {closure}(1024, 'see? no problem', '/in/222oU', 9) #1 /in/222oU(9): trigger_error('see? no problem') #2 {main} thrown in /in/222oU on line 9
Process exited with code 255.
Output for 7.1.25 - 7.1.28, 7.2.0 - 7.2.33, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16
Notice: this is no problem - just a notice in /in/222oU on line 3 this will still work fine: Fatal error: Uncaught ErrorException: see? no problem in /in/222oU:9 Stack trace: #0 [internal function]: {closure}(1024, 'see? no problem', '/in/222oU', 9, Array) #1 /in/222oU(9): trigger_error('see? no problem') #2 {main} thrown in /in/222oU on line 9
Process exited with code 255.