- var_dump: documentation ( source)
- array_column: 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_column(
$original,
'name',
'id'
)
);
This script was stopped while abusing our resources