Why was the 'FILTER_FLAG_HOST_REQUIRED' option removed from the filter_var function in PHP?

The 'FILTER_FLAG_HOST_REQUIRED' option was removed from the filter_var function in PHP because it was deemed unnecessary and redundant. Instead, the 'FILTER_VALIDATE_URL' filter with the 'FILTER_FLAG_PATH_REQUIRED' flag can be used to achieve the same effect of requiring a valid host in a URL.

$url = "https://www.example.com";
if (filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
    echo "Valid URL with required host.";
} else {
    echo "Invalid URL or host is missing.";
}