If $host is null str_replace() will throw a warning, no? Better to use empty string. Anyway, I don't see how is it possible to have $params to be null/not-set?
This is not the same. What if the config is an empty string for some reason?
Again, this is not the same.