3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a=[ 'x' => 'xx', 'y' => 'yy', 'z' => 'zz', ]; $x=array_map(function($v,$k){ echo $v; },$a);
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 2 expected in /in/9L0bT:10 Stack trace: #0 [internal function]: {closure}('xx') #1 /in/9L0bT(12): array_map(Object(Closure), Array) #2 {main} thrown in /in/9L0bT on line 10
Process exited with code 255.
Output for 5.4.10 - 7.0.20
Warning: Missing argument 2 for {closure}() in /in/9L0bT on line 10 xx Warning: Missing argument 2 for {closure}() in /in/9L0bT on line 10 yy Warning: Missing argument 2 for {closure}() in /in/9L0bT on line 10 zz
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/9L0bT on line 3
Process exited with code 255.