3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2 ,3); array_walk($a, function(&$i, $k, $pos) { $i++; }); var_dump($a);
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 2 passed and exactly 3 expected in /in/DuPLH:6 Stack trace: #0 [internal function]: {closure}(1, 0) #1 /in/DuPLH(6): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/DuPLH on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 2 passed and exactly 3 expected in /in/DuPLH:6 Stack trace: #0 [internal function]: {closure}(1, 0) #1 /in/DuPLH(8): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/DuPLH on line 6
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33
Warning: Missing argument 3 for {closure}() in /in/DuPLH on line 6 Warning: Missing argument 3 for {closure}() in /in/DuPLH on line 6 Warning: Missing argument 3 for {closure}() in /in/DuPLH on line 6 array(3) { [0]=> int(2) [1]=> int(3) [2]=> int(4) }

preferences:
206.68 ms | 402 KiB | 326 Q