3v4l.org

run code in 300+ PHP versions simultaneously
<?php $host = "https://chat.stackoverflow.com/rooms/11/php/"; $currentDomain = preg_replace('(^.+\.(?=[^.]+\.[^.]+$))', '', $host); echo $currentDomain;

preferences:
57.49 ms | 1406 KiB | 5 Q