3v4l.org

run code in 200+ php & hhvm versions
<?php var_dump(parse_url("127.0.0.1:80", PHP_URL_HOST)); var_dump(parse_url("[::1]:80", PHP_URL_HOST));
Output for 5.1.2 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.6
string(9) "127.0.0.1" NULL
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_HOST - assumed 'PHP_URL_HOST' in /in/7uVWs on line 3 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/7uVWs on line 3 NULL Notice: Use of undefined constant PHP_URL_HOST - assumed 'PHP_URL_HOST' in /in/7uVWs on line 4 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/7uVWs on line 4 NULL