TypeError thrown

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