3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $host = $_SERVER['HTTP_HOST']; preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches); echo "domain name is: {$matches[0]}\n";
Output for 5.3.0 - 7.1.0
Notice: Undefined index: HTTP_HOST in /in/DtCBk on line 2 Notice: Undefined offset: 0 in /in/DtCBk on line 4 domain name is:
Output for 4.3.0 - 5.2.17
Notice: Undefined index: HTTP_HOST in /in/DtCBk on line 2 Notice: Undefined offset: 0 in /in/DtCBk on line 4 domain name is: