3v4l.org

run code in 300+ PHP versions simultaneously
<?php function url_get_contents($url,$ref="http://google.com",$posts=false){ $crl = curl_init(); $timeout = 5; $userAgent = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36"; curl_setopt ($crl, CURLOPT_USERAGENT, $userAgent); curl_setopt ($crl, CURLOPT_URL, $url); curl_setopt ($crl, CURLOPT_ENCODING, 'UTF-8'); curl_setopt ($crl, CURLOPT_HEADER, false); curl_setopt ($crl, CURLOPT_REFERER, $ref); curl_setopt ($crl, CURLOPT_RETURNTRANSFER, true); curl_setopt ($crl, CURLOPT_FOLLOWLOCATION, true); curl_setopt ($crl, CURLOPT_AUTOREFERER, true); curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); if($posts){ curl_setopt ($crl, CURLOPT_POST, true); curl_setopt ($crl, CURLOPT_POSTFIELDS, http_build_query($posts)); } $ret = curl_exec($crl); $info = curl_getinfo($crl); if ($ret === false || $info['http_code'] != 200) { $ret = "No cURL data returned for $url [". $info['http_code']. "]"; if (curl_error($crl)) $ret .= "\n". curl_error($crl); } curl_close($crl); return $ret; } echo url_get_contents("http://www.tibia.com"); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/pBev9:3 Stack trace: #0 /in/pBev9(31): url_get_contents('http://www.tibi...') #1 {main} thrown in /in/pBev9 on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.1 ms | 401 KiB | 8 Q