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"); ?>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: Undefined array key "domain" in /in/O9u4M on line 20 Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /in/O9u4M on line 20 Warning: require_once(): open_basedir restriction in effect. File(whois.class.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/O9u4M on line 4 Warning: require_once(whois.class.php): Failed to open stream: Operation not permitted in /in/O9u4M on line 4 Fatal error: Uncaught Error: Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M:4 Stack trace: #0 /in/O9u4M(26): getwhois('', '') #1 {main} thrown in /in/O9u4M on line 4
Process exited with code 255.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
Warning: Undefined array key "domain" in /in/O9u4M on line 20 Warning: require_once(): open_basedir restriction in effect. File(whois.class.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/O9u4M on line 4 Warning: require_once(whois.class.php): Failed to open stream: Operation not permitted in /in/O9u4M on line 4 Fatal error: Uncaught Error: Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M:4 Stack trace: #0 /in/O9u4M(26): getwhois('', '') #1 {main} thrown in /in/O9u4M on line 4
Process exited with code 255.
Output for 8.0.13
Warning: Undefined array key "domain" in /in/O9u4M on line 20 Warning: require_once(whois.class.php): Failed to open stream: No such file or directory in /in/O9u4M on line 4 Fatal error: Uncaught Error: Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M:4 Stack trace: #0 /in/O9u4M(26): getwhois('', '') #1 {main} thrown in /in/O9u4M on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0, 7.4.33
Notice: Undefined index: domain in /in/O9u4M on line 20 Warning: require_once(whois.class.php): failed to open stream: No such file or directory in /in/O9u4M on line 4 Fatal error: require_once(): Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M on line 4
Process exited with code 255.
Output for 7.1.26 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
Notice: Undefined index: domain in /in/O9u4M on line 20 Warning: require_once(): open_basedir restriction in effect. File(whois.class.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/O9u4M on line 4 Warning: require_once(whois.class.php): failed to open stream: Operation not permitted in /in/O9u4M on line 4 Fatal error: require_once(): Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M on line 4
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: require_once(whois.class.php): failed to open stream: No such file or directory in /in/O9u4M on line 4 Fatal error: require_once(): Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M on line 4
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined index: domain in /in/O9u4M on line 20 Warning: require_once(whois.class.php): failed to open stream: No such file or directory in /in/O9u4M on line 4 Fatal error: require_once(): Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5
Notice: Undefined index: domain in /in/O9u4M on line 20 Warning: getwhois(whois.class.php): failed to open stream: No such file or directory in /in/O9u4M on line 4 Fatal error: getwhois(): Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined index: domain in /in/O9u4M on line 20 Warning: getwhois(whois.class.php) [http://www.php.net/function.getwhois]: failed to create stream: No such file or directory in /in/O9u4M on line 4 Fatal error: getwhois() [http://www.php.net/function.getwhois]: Failed opening required 'whois.class.php' (include_path='.:') in /in/O9u4M on line 4

preferences:
167.97 ms | 402 KiB | 341 Q