PHP 7.3: Deprecate
FILTER_FLAG_HOST_REQUIRED flags used with
When you use
filter_var($var, FILTER_VALIDATE_URL), there are two additional flags you could use to ensure the URL is strictly validated:
FILTER_FLAG_HOST_REQUIRED. These two flags are deprecated in PHP 7.3 onwards.
Since PHP 5.2.1, these two flags are implicitly enforced regardless they were used or not. If you have any code that uses these flags, simply remove them and you will be good. At this point, there are over 5,000 code search results on GitHub with these flags being used, and so could be yours.
Backwards compatibility impact
Because these two flags are now deprecated, you will see a notice like this:
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in ...
All you have to do is simply remove these two flags, because both of them are implied when you use