3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $hostname = 'localhost'; var_dump(parse_url($hostname, PHP_URL_HOST)); var_dump(parse_url($hostname, PHP_URL_PORT)); list($hostname, $port) = explode(':', 'localhost:3000'); var_dump($hostname); var_dump($port);
Output for 5.1.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
NULL NULL string(9) "localhost" string(4) "3000"
Output for 4.3.0 - 5.1.1
<br /> <b>Warning</b>: parse_url() expects exactly 1 parameter, 2 given in <b>/in/I7Up3</b> on line <b>3</b><br /> NULL <br /> <b>Warning</b>: parse_url() expects exactly 1 parameter, 2 given in <b>/in/I7Up3</b> on line <b>4</b><br /> NULL string(9) "localhost" string(4) "3000"