3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $names = array( array('id' => 123, 'name' => 'A'), array('id' => 456, 'name' => 'B'), array('id' => 789, 'name' => 'C'), ); $ids = array_map(function ($name) { return $name['id']; }, $names); var_dump($ids); // output array(3) { [0] => int(123) [1] => int(456) [2] => int(789) }
Output for 5.3.0 - 5.4.23
Parse error: syntax error, unexpected '{' in /in/ZcK19 on line 16
Process exited with code 255.