I'm trying to validate an IP using the FILTER_FLAG_NO_RES_RANGE but it fails. If I remove that flag the IP validates. The same is true for the FILTER_FLAG_NO_PRIV_RANGE flag, which I also want to include. I tried it with php 7.1 through 7.4 - all fail. Any ideas what might be causing this? Here's my test code.
$ip = "66.249.70.187";
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4, FILTER_FLAG_NO_RES_RANGE))
echo "$ip is valid" ;
else
echo "$ip is not valid" ;