xref: /PHP-5.4/ext/filter/tests/bug53150.phpt (revision d1314893)
1--TEST--
2Bug #53150 (FILTER_FLAG_NO_RES_RANGE is missing some IP ranges)
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7var_dump(filter_var('127.0.0.1', FILTER_VALIDATE_IP));
8var_dump(filter_var("::1", FILTER_VALIDATE_IP));
9
10var_dump(filter_var('127.0.0.1', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
11var_dump(filter_var('::1', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
12
13var_dump(filter_var('128.0.0.1', FILTER_VALIDATE_IP));
14var_dump(filter_var('128.0.0.1', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
15
16var_dump(filter_var('191.255.0.0', FILTER_VALIDATE_IP));
17var_dump(filter_var('191.255.0.0', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
18
19?>
20--EXPECT--
21string(9) "127.0.0.1"
22string(3) "::1"
23bool(false)
24bool(false)
25string(9) "128.0.0.1"
26string(9) "128.0.0.1"
27string(11) "191.255.0.0"
28string(11) "191.255.0.0"
29