- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.8
- Parse error: syntax error, unexpected ')' in /in/ttkdj on line 19
Process exited with code 255.
<?php
function mapCallback($callback, $array){
$output = [];
array_map(function($value) {
$callback($value, function($value) use (&$output) {
$output[] = $value;
});
}, $array);
return $output;
}
function mapCallback($callback, $array){
$output = [];
$push = function ($value) use (&$output) {
$output[] = $value;
});
foreach ($array as $value) {
$callback($value, $push);
}
return $output;
}