TypeError thrown

array_search(): Argument #2 ($haystack) must be of type array, null given