3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getHTTPInfo($url, $followLocation = false) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_NOBODY, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_MAXREDIRS, 5); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, $followLocation); curl_exec($curl); $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE); $effectiveURL = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); curl_close($curl); return array('http_code' => $httpStatus, 'effective_url' => $effectiveURL); } $result = getHTTPInfo('http://plantpath.unl.edu/', true); var_dump($result);
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/isM5l:4 Stack trace: #0 /in/isM5l(23): getHTTPInfo('http://plantpat...', true) #1 {main} thrown in /in/isM5l on line 4
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/isM5l on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: curl_init() in /in/isM5l on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: curl_init() in /in/isM5l on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: curl_init() in /in/isM5l on line 4