3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ch = curl_init(); $hostname = 'www.baidu.com'; $url = "https://{$hostname}/163608693694254"; $cert = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'facebook-php-sdk-master'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'fb_ca_chain_bundle.crt'); echo "IP address: ".gethostbyname($hostname)."<br/>"; echo "Certificate path: {$cert}<br/>\n"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_SSLVERSION,3); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_CERTINFO, true); $result = curl_exec($ch); echo "cURL Error: (".curl_errno($ch).") ".curl_error($ch)."<br/>\n"; echo "<pre>".print_r(curl_getinfo($ch), true)."</pre><br/>\n"; echo "<pre>".htmlspecialchars($result)."</pre>"; curl_close($ch); ?>
based on KquvQ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/Bq2Bg:2 Stack trace: #0 {main} thrown in /in/Bq2Bg on line 2
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/Bq2Bg on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: curl_init() in /in/Bq2Bg on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: curl_init() in /in/Bq2Bg on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: curl_init() in /in/Bq2Bg on line 2