3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function doHttpRequest($url, $post_data = NULL, $method = 'GET') { $ch = curl_init(); $options = array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE, CURLOPT_CUSTOMREQUEST => $method ); if (isset($post_data)){ if($method == "POST") { $options[CURLOPT_POST] = TRUE; $options[CURLOPT_POSTFIELDS] = $post_data; } else { $options[CURLOPT_URL] = $url .'?'. http_build_query($post_data,'','&'); } } curl_setopt_array($ch, $options); $response = curl_exec($ch); curl_close($ch); return $response; } $post_data = array( 'apiKey' => 'bbd9f56b9ec239745931df1026baee74', 'campaign' => '4732' ); $data = doHttpRequest('http://theappreciationengine.com/api/top',$post_data); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/OrZ83:3 Stack trace: #0 /in/OrZ83(27): doHttpRequest('http://theappre...', Array) #1 {main} thrown in /in/OrZ83 on line 3
Process exited with code 255.
Output for hhvm-3.12.0
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/OrZ83 on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: curl_init() in /in/OrZ83 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: curl_init() in /in/OrZ83 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: curl_init() in /in/OrZ83 on line 3