Just a warning that re-indexing an array by array_values() may cause you to reach the memory limit unexpectly.
For example, if your PHP momory_limits is 8MB,
and says there's a BIG array $bigArray which allocate 5MB of memory.
Doing this will cause PHP exceeds the momory limits:
<?php
$bigArray = array_values( $bigArray );
?>
It's because array_values() does not re-index $bigArray directly,
it just re-index it into another array, and assign to itself later.