<?php
$array = [1, 2, 3, 4];
$callable = function($value, $key, array &$output) {
$output[$key] $value * 100;
};
$output = [];
array_map($callable, $array, array_keys($array), $output);
print_r($output);
- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
- Parse error: syntax error, unexpected '$value' (T_VARIABLE) in /in/hfc1I on line 5
Process exited with code 255.
preferences:
166.86 ms | 1395 KiB | 23 Q