go to bug id or search bugs for
According to RFC 1034, a domain name label cannot exceed 63 characters
According to RFC 1035 the total length of an hostname cannot exceed 253 characters (optional final dot not included)
According to RFC 952 and RFC 1123 a domain name label cannot start nor end with a non alphanumeric char (the current implementation only check the first character of the hostname)
According to RFC 2732 an IPv6 address enclosed with square brackets is a valid hostname
The PR #826 (https://github.com/php/php-src/pull/826) make the FILTER_VALIDATE_URL filter compliant with that.
Tests updated in the PR.
Add a Patch
Add a Pull Request
Apparently, the PR/bugfix was never applied to PHP 5.x: https://3v4l.org/8PsSN