3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<? $token = 'be172a73a9e1f002be93b869d60af992'; $marker = '28184'; $aParams = array( 'search[params_attributes][origin_name]' => 'MOW', 'search[params_attributes][destination_name]' => 'LED', 'search[params_attributes][depart_date]' => '2014-04-04', 'search[params_attributes][range]' => '0', 'search[params_attributes][adults]' => '1', 'search[params_attributes][children]' => '0', 'search[params_attributes][infants]' => '0', 'search[params_attributes][trip_class]' => '0', 'search[params_attributes][direct]' => '0', ); ksort($aParams); $signature = md5("$token:$marker:".implode(':', array_values($aParams))); $bParams = array( 'signature' => $signature, 'enable_api_auth' => true, 'marker' => $marker ); $aParams = $aParams + $bParams; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://nano.aviasales.ru/searches.json'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($aParams)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1); $answer = curl_exec($ch); if(curl_errno($ch)) echo 'Curl error: ' . curl_error($ch); curl_close($ch); echo $answer; ?>
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/rPotv:23 Stack trace: #0 {main} thrown in /in/rPotv on line 23
Process exited with code 255.
Output for 5.4.0 - 5.4.25, 5.4.34 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/rPotv on line 23
Process exited with code 255.
Output for 4.3.0 - 5.3.29, 5.4.26 - 5.4.32
<? $token = 'be172a73a9e1f002be93b869d60af992'; $marker = '28184'; $aParams = array( 'search[params_attributes][origin_name]' => 'MOW', 'search[params_attributes][destination_name]' => 'LED', 'search[params_attributes][depart_date]' => '2014-04-04', 'search[params_attributes][range]' => '0', 'search[params_attributes][adults]' => '1', 'search[params_attributes][children]' => '0', 'search[params_attributes][infants]' => '0', 'search[params_attributes][trip_class]' => '0', 'search[params_attributes][direct]' => '0', ); ksort($aParams); $signature = md5("$token:$marker:".implode(':', array_values($aParams))); $bParams = array( 'signature' => $signature, 'enable_api_auth' => true, 'marker' => $marker ); $aParams = $aParams + $bParams; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://nano.aviasales.ru/searches.json'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($aParams)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1); $answer = curl_exec($ch); if(curl_errno($ch)) echo 'Curl error: ' . curl_error($ch); curl_close($ch); echo $answer; ?>