3v4l.org

run code in 150+ 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_CAINFO, $cert); 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 AAi1m
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/KquvQ:2 Stack trace: #0 {main} thrown in /in/KquvQ on line 2
Process exited with code 255.
Output for hhvm-3.12.0
IP address: www.baidu.com<br/>Certificate path: <br/> Notice: Use of undefined constant CURLOPT_CERTINFO - assumed 'CURLOPT_CERTINFO' in /in/KquvQ on line 20 Warning: curl_setopt() expects parameter 2 to be integer, string given in /in/KquvQ on line 20 cURL Error: (6) Could not resolve host: www.baidu.com<br/> <pre>Array ( [url] => https://www.baidu.com/163608693694254 [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [local_port] => 0 [total_time] => 0.02015 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 ) </pre><br/> <pre></pre>
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/KquvQ 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/KquvQ 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/KquvQ 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/KquvQ on line 2