3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php set_time_limit(300); echo 'START'; flush(); $key = "hKRDnKagmecgYVrrDwBb"; $token = "5fqicwqzql1HsVE5uXnKubyvyKOaX4mYddL0"; $accountId = "28"; //$url = "https://dataapi.autoplay.co.nz/"; $url = "https://dataapi.aptest.co.nz/"; $fred = "?id=".$accountId; $fred .= "&yard=2867"; $fred .= "&pageSize=2"; $fred .= "&pageNumber=1"; $ch = curl_init($url.'search.ashx'.$fred); curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // uncomment this line if you get no gateway response. ### curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_MAXREDIRS, 5); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_STDERR, $fp); $headers = array( 'Key: '.$key, 'Token: '.$token ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLINFO_HEADER_OUT, true); //curl_setopt($ch, CURLOPT_URL, $url."search.asx" ); //curl_setopt($ch, CURLOPT_POST, true ); //curl_setopt($ch, CURLOPT_POSTFIELDS, $Something is wrong); // use HTTP POST to send form data echo '<br>GOING TO DO REQUEST'; flush(); $result = curl_exec($ch); $headers_info = curl_getinfo($ch); echo "HEADERS:<pre>".print_r($headers_info, true)."</pre>"; flush(); echo "RESULT:<pre>".print_r($result, true)."</pre>"; flush(); ?>
Output for 7.0.0 - 7.3.0alpha1
START Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/r8WLW:19 Stack trace: #0 {main} thrown in /in/r8WLW on line 19
Process exited with code 255.
Output for hhvm-3.15.4
START Notice: Undefined variable: fp in /in/r8WLW on line 27 <br>GOING TO DO REQUESTHEADERS:<pre>Array ( [url] => https://dataapi.aptest.co.nz/search.ashx?id=28&yard=2867&pageSize=2&pageNumber=1 [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.000151 [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>RESULT:<pre></pre>
Output for 5.6.0 - 5.6.30
START Fatal error: Call to undefined function curl_init() in /in/r8WLW on line 19
Process exited with code 255.