3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(1, 2 ,3); array_walk($a, function(&$i, $k, $pos) { $i++; }); var_dump($a);
based on 1HM4Y
Output for 7.1.0 - 7.2.0
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 - 7.0.20
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) }