PHP's array_shift Performance

< 1 minute readPHP’s array_shift is a relatively slow way to fetch the first item from an array; it’s much better to use reset. For example, array_shift() modifies the original array and can be pretty slow because it needs to completely reindex the array (remove first element then shuffle everything else forward by one “slot”), so unless you […]

Read More PHP's array_shift Performance