3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getwhois($domain, $tld) { require_once("whois.class.php"); $whois = new Whois(); if( !$whois->ValidDomain($domain.'.'.$tld) ){ return 'Sorry, the domain is not valid or not supported.'; } if( $whois->Lookup($domain.'.'.$tld) ) { return $whois->GetData(1); }else{ return 'Sorry, an error occurred.'; } } $domain = trim($_REQUEST['domain']); $dot = strpos($domain, '.'); $sld = substr($domain, 0, $dot); $tld = substr($domain, $dot+1); $whois = getwhois($sld, $tld); echo " "; echo $whois; echo " "; getwhois("summoner","io"); ?>

preferences:
31.2 ms | 402 KiB | 5 Q