array_merge速度慢 作者:Admin PHP 时间:2021-11-09 16:54:51 1824人已阅读 个人博客 简介数据量大的时候array_merge速度会特别慢 > 当数据量大的时候array_merge的速度极慢,可用+优化或者循环往数组中添加 ###array_merge 和 +会有一些区别 ###array_merge 1. 如果合并的数组中有相同的字符串键名,则后面的值覆盖前面的值,键名不变 2. 如果合并的数组中有相同的数字键名,则后面的值不覆盖前面的值,而是依次附加到后面 3. 如果只有一个数组,并且该数组是数字索引的,则键名会以连续方式重新索引 ###+ 1. 如果合并的数组中有相同的字符串键名,则取最先出现的值而把后面拥有相同键名的那些值“抛弃” 2. 如果合并的数组中有相同的数字键名,则取最先出现的值而把后面拥有相同键名的那些值“抛弃” 3. 如果只有一个数组,并且该数组是数字索引的,则键名会以连续方式重新索引 上一篇: Golang交叉编译 下一篇: 二进制搭建PHP