I have a checkmark, the value of array_value is 3 times faster (sorry for answering my own question, the comments section does not save the format)
for and array with elements 8043
array values ββtook 0.003291130065918 seconds.
array merge took 0.0096800327301025 seconds.
$ shuf is an unindexed array
Below is the code to run the test (copied from the site)
$sha1_start = microtime(true); $arraymerge = array_merge ($shuf); $shal_elapsed = microtime(true) - $sha1_start; $start = microtime(true); $arrayvalue = array_values ($shuf); $elapsed = microtime(true) - $start; echo "<br>array values took $elapsed seconds."; echo "<br>array merge took $shal_elapsed seconds.";
Jamex
source share