move logic out of `array_shift` to avoid strict standards warnings