3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Paramètres $uri = '/api/channel/2015-12-06/1403.xml'; $applicationId = 'TDF'; $password = 'L2a4mZK5'; $secretKey = '7743310e629f0419398fbf910e34d1011005'; // Préparation des paramètres d'appel // gmdate() : Retourne une date sous forme d'une chaîne, selon un format donné. Le temps retourné est GMT. // time() : Retourne l'heure courante mesurée en secondes, depuis le début de l'époque UNIX $date = gmdate("D, d M Y H:i:s", time()).' GMT'; $string2sign = 'GET ' . $uri . ' ' . $secretKey; // base64_encode() : Encore la chaîne donnée en paramètre en base64. // hash_hmac() : Génère une valeur de clé de hachage en utilisant la méthode HMAC. // utf8_encode() : Encode la chaîne donnée en paramètre en utf8. $signature = base64_encode( hash_hmac( 'sha1', utf8_encode( $string2sign ), $password ) ); $Authorization = 'PLWS ' . $applicationId . ':' . $signature; $curlUrl = 'http://api-tv.plurimedia.fr' . $uri; // Préparation des headers $headers = array(); $headers[] = 'Accept: application/json'; $headers[] = 'Pluri-Key: ' . $Authorization; $headers[] = 'Content-Type: application/json'; $headers[] = 'Date: ' . $date; // Appel cURL // curl_init() : Permet de récupérer le contenu d'une page Web $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_URL, $curlUrl); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_HEADER, 1); $response = curl_exec ($ch); $info = curl_getinfo($ch); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $body = substr($response, $header_size); curl_close ($ch); // Votre XML se trouve dans la variable $body. header('Content-Type:text/xml'); echo $body; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.60.0060.01016.98
7.2.00.0140.00719.43
7.1.200.0040.00715.88
7.1.100.0000.01017.65
7.1.70.0050.00317.01
7.1.60.0070.01719.52
7.1.50.0060.01317.05
7.1.00.0070.07322.37
7.0.200.0060.00317.01
7.0.90.0570.07719.92
7.0.80.0570.07719.95
7.0.70.0300.05019.96
7.0.60.0370.08019.96
7.0.50.0400.08720.25
7.0.40.0130.07720.13
7.0.30.0100.05320.08
7.0.20.0170.07320.14
7.0.10.0100.08019.95
7.0.00.0070.08020.13
5.6.280.0030.06021.11
5.6.240.0070.06320.61
5.6.230.0100.08320.60
5.6.220.0100.09020.69
5.6.210.0070.07320.76
5.6.200.0030.07721.05
5.6.190.0100.08021.12
5.6.180.0130.06721.03
5.6.170.0030.08721.05
5.6.160.0070.04721.05
5.6.150.0070.08721.13
5.6.140.0100.07321.08
5.6.130.0130.08021.12
5.6.120.0030.08021.06
5.6.110.0130.06721.02
5.6.100.0000.05021.13
5.6.90.0030.04721.12
5.6.80.0130.06720.36
5.6.70.0070.05320.50
5.6.60.0030.08320.34
5.6.50.0000.08020.30
5.6.40.0070.07020.43
5.6.30.0000.06720.51
5.6.20.0100.08320.46
5.6.10.0100.06720.44
5.6.00.0030.08320.39
5.5.380.0000.05020.43
5.5.370.0100.07720.46
5.5.360.0100.08020.37
5.5.350.0100.06720.43
5.5.340.0030.08320.65
5.5.330.0100.07720.79
5.5.320.0070.08320.88
5.5.310.0130.03320.72
5.5.300.0100.08320.89
5.5.290.0130.04020.93
5.5.280.0100.06720.91
5.5.270.0130.07320.73
5.5.260.0130.07320.89
5.5.250.0130.08720.68
5.5.240.0030.04020.22
5.5.230.0030.04020.21
5.5.220.0000.04020.22
5.5.210.0000.08020.01
5.5.200.0000.06320.29
5.5.190.0070.06720.23
5.5.180.0130.08020.14
5.5.160.0070.07020.19
5.5.150.0000.08020.12
5.5.140.0070.06020.23
5.5.130.0100.08020.22
5.5.120.0030.07020.15
5.5.110.0130.05020.28
5.5.100.0130.08020.18
5.5.90.0100.08320.04
5.5.80.0130.06720.16
5.5.70.0030.06020.11
5.5.60.0100.07320.04
5.5.50.0070.08319.94
5.5.40.0100.06020.10
5.5.30.0100.07020.06
5.5.20.0030.08320.10
5.5.10.0070.08320.12
5.5.00.0030.07320.05

preferences:
37.57 ms | 401 KiB | 5 Q