|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80116 filter_var rejects scoped IPv6 literal addresses
Submitted: 2020-09-17 10:43 UTC Modified: -
From: kieran at supportpal dot com Assigned:
Status: Open Package: Filter related
PHP Version: 8.0.0beta3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kieran at supportpal dot com
New email:
PHP Version: OS:


 [2020-09-17 10:43 UTC] kieran at supportpal dot com
filter_var rejects IPv6 scoped literal addresses. Scoped literal addresses are described at

[RFC 4007](

a common notation to specify the scope zone, an implementation SHOULD
support the following format:
      <address> is a literal IPv6 address,
      <zone_id> is a string identifying the zone of the address, and
      `%' is a delimiter character to distinguish between <address> and

Test script:


$ip = "fe80::3549:8417:2ad0:ef6a%4";
var_dump(filter_var($ip, FILTER_VALIDATE_IP));

Expected result:
return true

Actual result:
return false


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-17 11:15 UTC] kieran at supportpal dot com
Perhaps a feature request for RFC 4007 support instead of a bug.

inet_pton also fails with the address mentioned in the example.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 27 12:01:22 2020 UTC