3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $referer = 'http://chameleon.online.dev/'; // Извлекаем имя хоста из URL //preg_match('@^(^http://[.*]/)?(.*)@i', // $referer, $matches); preg_match('@^(?:http://)?([^/]+)@i', $referer, $matches); $host = $matches; var_dump($host);
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> string(27) "http://chameleon.online.dev" [1]=> string(20) "chameleon.online.dev" }
Output for hhvm-3.10.0

Process exited with code 153.