3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $a = 1; $b = 2; echo $undef; } set_error_handler(function($a, $b, $c, $d, $e) { var_dump($e); }); test();
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 4 passed in /in/uq7JV on line 6 and exactly 5 expected in /in/uq7JV:8 Stack trace: #0 /in/uq7JV(6): {closure}(2, 'Undefined varia...', '/in/uq7JV', 6) #1 /in/uq7JV(9): test() #2 {main} thrown in /in/uq7JV on line 8
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 4 passed and exactly 5 expected in /in/uq7JV:8 Stack trace: #0 /in/uq7JV(6): {closure}(2, 'Undefined varia...', '/in/uq7JV', 6) #1 /in/uq7JV(9): test() #2 {main} thrown in /in/uq7JV on line 8
Process exited with code 255.
Output for 5.5.0 - 5.5.36, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
array(2) { ["a"]=> int(1) ["b"]=> int(2) }

preferences:
237.26 ms | 403 KiB | 216 Q