3v4l.org

run code in 300+ PHP versions simultaneously
<? $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 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.26 - 5.4.32, 7.2.29 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<? $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.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1, 7.3.32 - 7.3.33, 7.4.33, 8.0.13
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.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/rPotv on line 23
Process exited with code 255.

preferences:
204.18 ms | 402 KiB | 329 Q