3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (isDomainAvailible('http://www.panet.co.il')) { echo "Up and running!"; } else { echo "Woops, nothing found there."; } //returns true, if domain is availible, false if not function isDomainAvailible($domain) { //check, if a valid url is provided if(!filter_var($domain, FILTER_VALIDATE_URL)) { return false; } //initialize curl $curlInit = curl_init($domain); curl_setopt($curlInit,CURLOPT_CONNECTTIMEOUT,10); curl_setopt($curlInit,CURLOPT_HEADER,true); curl_setopt($curlInit,CURLOPT_NOBODY,true); curl_setopt($curlInit,CURLOPT_RETURNTRANSFER,true); //get answer $response = curl_exec($curlInit); curl_close($curlInit); if ($response) return true; return false; }
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/Wr63E:22 Stack trace: #0 /in/Wr63E(3): isDomainAvailible('http://www.pane...') #1 {main} thrown in /in/Wr63E on line 22
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Call to undefined function curl_init() in /in/Wr63E on line 22
Process exited with code 255.

preferences:
230.18 ms | 401 KiB | 287 Q