xref: /php-src/ext/filter/tests/gh16523.phpt (revision f9ce5e79)
1--TEST--
2GH-16523 (FILTER_FLAG_HOSTNAME accepts ending hyphen)
3--EXTENSIONS--
4filter
5--FILE--
6<?php
7$domains = [
8    'a-.bc.com',
9    'a.bc-.com',
10    'a.bc.com-',
11];
12
13foreach ($domains as $domain) {
14    var_dump(filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME));
15}
16?>
17--EXPECT--
18bool(false)
19bool(false)
20bool(false)
21