Error thrown

array_shift(): Argument #1 ($array) cannot be passed by reference