- array_map: documentation ( source)
- var_dump: documentation ( source)
- str_repeat: documentation ( source)
- range: documentation ( source)
<?php
$original = [];
foreach (range(1, 20_000) as $iteration) {
$original[] = [
'id' => str_repeat("{$iteration}.", 4),
'name' => 'name',
];
}
var_dump(
array_map(
static function (array $item): string {
return "{$item['id']}#{$item['name']}";
},
$original
)
);
This script was stopped while abusing our resources