TypeError thrown

array_replace_recursive(): Argument #1 ($array) must be of type array, null given