php 性能优化的一些写法
12 January 2018

主要来自于 phpstorm 的提示
array_merge 来源:https://github.com/kalessil/phpinspectionsea/blob/master/docs/performance.md#slow-array-function-used-in-loop

$options = [];
foreach ($configurationSources as $source) {
    $options = array_merge($options, $source->getOptions());
}


$options = [[]];
foreach ($configurationSources as $source) {
    $options[] = $source->getOptions(); // <- yes, we'll use a little bit more memory
}

$options = array_merge(...$options);