TypeError thrown

array_slice(): Argument #1 ($array) must be of type array, bool given