3v4l.org

run code in 300+ PHP versions simultaneously
<?php include_once "utils.php"; // INIZIO CONTROLLI $Errore = 0; $Avviso = ''; $Variabile_LaFour = ''; $Contenuto=""; $ContenutoMappa=""; $Uscita=""; $Header=""; $Header2=""; $Viaggi=""; $Viaggi2=array(); $Tabella=""; $Alias64=""; $DatiMezzi=""; if (isset($_REQUEST['Next'])) { $Subpage=$_REQUEST['Next']; } else { $Subpage=''; } if (!isset($_REQUEST['CodiceAutenticazione'])) { $_REQUEST['CodiceAutenticazione'] = ''; } //Primo ingresso oppure errore nell'autenticazione o verifica if (!isset($_REQUEST['Stato'])) { $Avviso="Attenzione, per visualizzare questa pagina รจ necessario aver eseguito l'accesso all'aria riservata!"; } if ($Errore=='0' AND isset($_REQUEST['Stato']) AND ($_REQUEST['Stato']=='Viaggi' OR $_REQUEST['Stato']=='Localizza')) { $Risultato = Verifica($_REQUEST['CodiceAutenticazione'],$Variabile_LaFour); if ($Risultato[0] == '0') { $Connessione = mysql_connect('localhost','',''); mysql_select_db('trasporti'); if ($_REQUEST['Stato']=='Localizza' AND $Subpage=='Localizza') { $DatiGPS="SELECT mg.latitudine, mg.longitudine, mg.velocita, mg.angolo, mg.evento, mg.dataora, m.alias, m.tipologia, m.rapporto, m.targa, m.targa2, m.id_mezzo FROM mezzi_gps mg JOIN mezzi m ON mg.id_apparecchio = m.codice_gps and mg.latitudine!='' and mg.longitudine!='' WHERE m.id_anagrafica='".$Risultato[1]."' "; $QDatiGPS=mysql_query($DatiGPS); $Righe=mysql_num_rows($QDatiGPS); if ($Righe!=0) { for ($i=0; $i < $Righe; $i++) { $Alias=addslashes(mysql_result($QDatiGPS, $i, 'm.alias')); $Tipologia=strtoupper(mysql_result($QDatiGPS, $i, 'm.tipologia')); $Rapporto=strtoupper(mysql_result($QDatiGPS, $i, 'm.rapporto')); $Targa=strtoupper(mysql_result($QDatiGPS, $i, 'm.targa')); $Targa2=strtoupper(mysql_result($QDatiGPS, $i, 'm.targa2')); if ($Targa2!='') { $Targa=$Targa." - ".$Targa2; } $ID_Mezzo=mysql_result($QDatiGPS, $i, 'm.id_mezzo'); $Lat=mysql_result($QDatiGPS, $i, 'mg.latitudine'); //$ALat=explode(",",$Lat); //$NLat=$ALat[0].".".$ALat[1]; $Long=mysql_result($QDatiGPS, $i, 'mg.longitudine'); //$ALong=explode(",",$Long); //$NLong=$ALong[0].".".$ALong[1]; $Evento=mysql_result($QDatiGPS, $i, 'mg.evento'); $Velocita=mysql_result($QDatiGPS, $i, 'mg.velocita'); $Angolo=mysql_result($QDatiGPS, $i, 'mg.angolo'); $DataOra=mysql_result($QDatiGPS, $i, 'mg.dataora'); if ($Tracker!='') { $Acc1=mysql_result($QDatiGPS, $i, 'mg.acc'); } $DataOraUNIX=strtotime($DataOra); $DataAttuale=strtotime(date('Y-m-d H:i:s')); $DifferenzaOra=$DataAttuale-$DataOraUNIX; $oggi=date("Y-m-d"); // gestione controllo mezzo carico o vuoto $DatiCarico="SELECT DISTINCT(v.id_viaggio), if (v.andataritorno=0, max(vt.ordinetappa), max(vt.ordinetappa)-1) as tappamax FROM viaggi v join viaggi_tappe vt on v.id_viaggio = vt.id_viaggio WHERE v.cancellata=0 and vt.cancellata=0 and date(vt.dataora)>='".$oggi."' and v.id_mezzo='".$ID_Mezzo."' GROUP BY v.id_viaggio "; $QueryCarico=mysql_query($DatiCarico); $RigheCarico=mysql_num_rows($QueryCarico); for ($z=0; $z<$RigheCarico; $z++) { $ID_ViaggioCar=mysql_result($QueryCarico,$z,'v.id_viaggio'); $MaxTappaCar=mysql_result($QueryCarico,$z,'tappamax'); $RigheCarico2=""; $DatiCarico2="SELECT * FROM viaggi_tappe vt WHERE vt.id_viaggio='".$ID_ViaggioCar."' and vt.ordinetappa='".$MaxTappaCar."' and vt.dataripartenza IS NULL UNION SELECT * FROM viaggi_tappe vt WHERE vt.id_viaggio='".$ID_ViaggioCar."' and vt.ordinetappa='1' and vt.dataripartenza IS NOT NULL "; $QueryCarico2=mysql_query($DatiCarico2); $RigheCarico2=mysql_num_rows($QueryCarico2); } // gestione icone if ($Tipologia=='BILICO') { $Icona='B'; } else { $Icona='A'; } if ($RigheCarico2==2) { $Icona.='C'; } else { $Icona.='V'; } if ($Tracker=='') { if ($Velocita>=1 AND $DifferenzaOra<=600) { $Icona.='M'; } elseif ($Velocita==0 AND $DifferenzaOra<=600) { $Icona.='F'; } else { $Icona.='P'; } } else { if ($Acc1==1 AND $DifferenzaOra<=600) { $Icona.='M'; } elseif ($Acc1==0 AND $DifferenzaOra<=600) { $Icona.='F'; } else { $Icona.='P'; } } if ($Angolo>=0 AND $Angolo <=89) { $Icona.='NE.gif'; } elseif ($Angolo>=90 AND $Angolo <=179) { $Icona.='SE.gif'; } elseif ($Angolo>=180 AND $Angolo <=269) { $Icona.='SO.gif'; } else { $Icona.='NO.gif'; } $DatiViaggi="SELECT a.alias, group_concat(concat(vl.comune, ' (', vl.provincia_sigla, ')') order by ordinetappa separator ' => ') as tappe, v.id_viaggio, v.numero_viaggio, v.andataritorno FROM viaggi v JOIN viaggi_tappe vt on v.id_viaggio = vt.id_viaggio JOIN anagrafiche a ON v.id_anagraficacliente = a.id_anagrafica JOIN vista_luoghi vl ON vt.id_luogo = vl.id_cap WHERE v.id_mezzo='".$ID_Mezzo."' and vt.cancellata=0 and v.id_viaggio in (select distinct viaggi.id_viaggio from viaggi join viaggi_tappe on viaggi.id_viaggio = viaggi_tappe.id_viaggio where viaggi.cancellata=0 and date(dataora)>='".$oggi."' ) GROUP BY vt.id_viaggio ORDER BY vt.dataora"; $QDatiViaggi=mysql_query($DatiViaggi); $RigheViaggi=mysql_num_rows($QDatiViaggi); for ($j=0; $j < $RigheViaggi; $j++) { $Tappe=mb_strtoupper(utf8_encode(mysql_result($QDatiViaggi, $j, 'tappe'))); $NViaggio=mysql_result($QDatiViaggi, $j, 'numero_viaggio'); if ($NViaggio=='') { $NViaggio=mysql_result($QDatiViaggi, $j, 'id_viaggio'); } $AR=mysql_result($QDatiViaggi, $j, 'andataritorno'); if ($AR==1) { $AR="(A/R)"; } else { $AR="(SA)"; } $RagioneSociale=strtoupper(mysql_result($QDatiViaggi, $j, 'a.alias')); if (isset($Viaggi2[$i])) { $Viaggi2[$i].=addslashes(($j+1).") VIAGGIO ".$NViaggio." ".$AR." CONTO ".$RagioneSociale."<br/>".$Tappe."<br/><br/>"); } else { $Viaggi2[$i]=addslashes(($j+1).") VIAGGIO ".$NViaggio." ".$AR." CONTO ".$RagioneSociale."<br/>".$Tappe."<br/><br/>"); } } if (!isset($Viaggi2[$i])) { $Viaggi2[$i]=""; } $DatiMezzi.="var latlong$i = new google.maps.LatLng($Lat,$Long); var infowindow$i = new google.maps.InfoWindow; var marker$i = new google.maps.Marker({ position: latlong$i, title:'', icon:'../icone/".$Icona."' }); marker$i.html = '<div style=\'width:450px;\'>$Targa<br/><br/>$Viaggi2[$i]</div>'; google.maps.event.addListener(marker$i, 'click', function(){ infowindow$i.setContent(this.html); infowindow$i.open(map, this);}); marker$i.setMap(map); "; } $script = "<meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=yes\" /><meta http-equiv=\"refresh\" content=\"600\"><style type=\"text/css\"> body { margin: 0px; padding: 10px; width:96%; height:96%; } #map_canvas { margin-left: auto; margin-right:auto; margin-top: auto; margin-bottom:auto; max-width:750px; height: 400px; width=750px; } </style> <script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?key=&sensor=false\"> </script> <script type=\"text/javascript\"> function initialize() { var mapOptions = { center: new google.maps.LatLng($Lat, $Long), zoom: 7, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById(\"map_canvas\"), mapOptions); $DatiMezzi } </script> "; $Contenuto=utf8_encode("<div style='margin-top:20px; text-align:center;'>LEGENDA: VERDE - IN MOTO; ROSSO - IN SOSTA; - NERO: NON DISPONIBILE</div>"); $ContenutoMappa="<div id=\"map_canvas\" style='margin-top:15px;'></div>"; } else { $Contenuto="<div style='margin-top:20px; text-align:center;'>Siamo spiacenti, ma il mezzo selezionato oggi non svolge alcun viaggio per il cliente.</div>"; } } mysql_close($Connessione); } else { $Avviso="Errore MEZVET1, si prega di contattare l'amministratore del sito riportando questo codice."; } } print "<html><head> <link type=\"text/css\" rel=\"stylesheet\" href=\"http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,800\" media=\"all\" /> <link type=\"text/css\" rel=\"stylesheet\" href=\"http://fonts.googleapis.com/css?family=Share:700italic\" media=\"all\" /> $script </head> <body onload=\"initialize()\" style=\"font-family: 'Open Sans', sans-serif; color:#777; font-size: 12px; line-height: 19px;\"> <p style=\"text-align: center;\">$Avviso$Contenuto</p>"; print "$ContenutoMappa</body></html>"; ?>

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)
8.3.60.0120.00318.46
8.3.50.0090.00821.98
8.3.40.0110.00719.04
8.3.30.0090.00619.36
8.3.20.0040.00420.41
8.3.10.0080.00023.64
8.3.00.0080.00317.73
8.2.180.0100.01017.13
8.2.170.0130.00922.96
8.2.160.0170.00320.51
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0070.01126.16
8.2.120.0080.00022.20
8.2.110.0060.00322.29
8.2.100.0090.00317.97
8.2.90.0090.00019.26
8.2.80.0030.00518.05
8.2.70.0080.00017.88
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0040.00418.27
8.2.20.0080.00017.97
8.2.10.0040.00418.30
8.2.00.0070.00318.03
8.1.280.0070.01425.92
8.1.270.0080.00823.88
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00623.80
8.1.230.0040.00719.22
8.1.220.0040.00417.91
8.1.210.0050.00318.77
8.1.200.0060.00317.60
8.1.190.0080.00017.88
8.1.180.0040.00418.10
8.1.170.0000.00818.73
8.1.160.0060.00322.20
8.1.150.0080.00018.87
8.1.140.0100.00017.74
8.1.130.0000.00717.93
8.1.120.0050.00317.55
8.1.110.0050.00317.70
8.1.100.0000.00717.65
8.1.90.0080.00017.54
8.1.80.0000.00817.66
8.1.70.0040.00417.65
8.1.60.0040.00817.80
8.1.50.0050.00317.80
8.1.40.0000.00817.74
8.1.30.0000.00917.83
8.1.20.0030.00517.90
8.1.10.0040.00417.77
8.1.00.0040.00417.73
8.0.300.0040.00418.77
8.0.290.0000.00817.41
8.0.280.0040.00418.74
8.0.270.0040.00417.50
8.0.260.0000.00717.36
8.0.250.0040.00417.27
8.0.240.0030.00317.13
8.0.230.0000.00717.16
8.0.220.0030.00317.07
8.0.210.0000.00717.23
8.0.200.0030.00317.25
8.0.190.0050.00217.26
8.0.180.0040.00417.11
8.0.170.0040.00417.13
8.0.160.0080.00017.15
8.0.150.0080.00417.03
8.0.140.0000.00917.16
8.0.130.0030.00313.64
8.0.120.0080.00017.14
8.0.110.0080.00017.16
8.0.100.0080.00017.17
8.0.90.0080.00017.20
8.0.80.0120.00317.26
8.0.70.0040.00417.24
8.0.60.0080.00017.12
8.0.50.0040.00417.11
8.0.30.0080.01217.13
8.0.20.0130.00617.44
8.0.10.0030.00517.25
8.0.00.0100.00716.90
7.4.330.0030.00315.09
7.4.320.0000.00716.59
7.4.300.0000.00716.60
7.4.290.0070.00016.70
7.4.280.0030.00616.76
7.4.270.0050.00316.71
7.4.260.0030.00316.80
7.4.250.0050.00316.80
7.4.240.0050.00316.66
7.4.230.0000.00716.59
7.4.220.0070.01116.61
7.4.210.0080.00716.83
7.4.200.0000.00716.61
7.4.190.0080.00016.75
7.4.160.0090.00616.77
7.4.150.0090.00917.40
7.4.140.0120.00617.86
7.4.130.0090.00916.80
7.4.120.0060.01116.63
7.4.110.0150.00416.68
7.4.100.0140.00416.77
7.4.90.0110.00716.75
7.4.80.0080.01119.39
7.4.70.0110.00616.83
7.4.60.0110.00716.75
7.4.50.0050.00316.55
7.4.40.0060.01022.77
7.4.30.0000.01716.75
7.4.00.0070.01015.40
7.3.330.0050.00013.41
7.3.320.0000.00513.27
7.3.310.0030.00516.57
7.3.300.0080.00016.58
7.3.290.0030.01016.58
7.3.280.0080.01016.55
7.3.270.0140.00317.40
7.3.260.0110.00716.59
7.3.250.0090.01016.67
7.3.240.0150.00616.64
7.3.230.0150.00316.82
7.3.210.0080.00816.77
7.3.200.0120.01219.39
7.3.190.0070.01016.82
7.3.180.0090.00616.64
7.3.170.0100.00616.75
7.3.160.0080.00816.62
7.3.120.0070.00715.10
7.3.110.0000.01415.11
7.3.100.0030.00715.09
7.3.90.0030.00614.72
7.3.80.0070.01115.12
7.3.70.0100.00614.77
7.3.60.0060.00915.11
7.3.50.0100.00315.05
7.3.40.0060.00915.09
7.3.30.0100.01015.09
7.3.20.0030.01016.52
7.3.10.0080.00416.61
7.3.00.0050.00916.80
7.2.330.0110.00816.62
7.2.320.0080.01216.80
7.2.310.0030.01316.90
7.2.300.0090.00916.83
7.2.290.0090.01316.92
7.2.240.0100.00715.18
7.2.230.0070.00715.25
7.2.220.0040.01215.20
7.2.210.0030.01315.21
7.2.200.0060.00915.36
7.2.190.0000.01815.16
7.2.180.0070.01015.17
7.2.170.0110.00715.30
7.2.160.0060.00815.32
7.2.150.0060.01217.19
7.2.140.0080.01116.79
7.2.130.0030.01116.93
7.2.120.0080.00916.95
7.2.110.0090.00516.99
7.2.100.0070.00716.77
7.2.90.0030.01017.17
7.2.80.0100.00616.95
7.2.70.0070.00516.99
7.2.60.0070.00617.07
7.2.50.0040.00916.96
7.2.40.0050.00716.93
7.2.30.0080.00516.81
7.2.20.0060.00916.99
7.2.10.0070.00717.08
7.2.00.0100.00517.72
7.1.330.0090.00615.77
7.1.320.0080.00415.96
7.1.310.0100.00315.73
7.1.300.0070.00315.86
7.1.290.0040.01115.66
7.1.280.0070.01015.91
7.1.270.0030.01015.88
7.1.260.0040.01215.91
7.1.250.0090.00515.85
7.1.200.0030.00915.81
7.1.100.0100.00617.75
7.1.70.0080.00817.00
7.1.60.0040.01819.46
7.1.50.0130.01016.99
7.1.00.0100.06722.38
7.0.200.0000.00916.82
7.0.140.0000.07722.21
7.0.100.0570.06720.00
7.0.90.0100.06320.26
7.0.80.0170.06719.99
7.0.70.0030.09320.08
7.0.60.0530.05720.09
7.0.50.0330.05020.36
7.0.40.0030.04720.18
7.0.30.0070.05020.10
7.0.20.0200.03720.03
7.0.10.0170.03720.17
7.0.00.0030.08020.07
5.6.250.0130.07720.64
5.6.240.0030.08720.68
5.6.230.0100.07720.71
5.6.220.0070.07020.72
5.6.210.0200.06720.62
5.6.200.0070.08021.04
5.6.190.0130.04021.18
5.6.180.0100.04721.09
5.6.170.0070.06721.11
5.6.160.0170.05021.18
5.6.150.0070.07021.10
5.6.140.0070.07021.23
5.6.130.0030.07721.08
5.6.120.0100.04721.19
5.6.110.0100.07721.09
5.6.100.0170.05021.22
5.6.90.0070.08320.98
5.6.80.0130.07320.53
5.6.70.0070.08320.55
5.6.60.0070.08020.48
5.6.50.0130.04320.54
5.6.40.0130.07020.34
5.6.30.0030.06020.50
5.6.20.0070.04020.53
5.6.10.0000.05020.32
5.6.00.0130.06320.52
5.5.380.0130.07020.59
5.5.370.0100.08020.39
5.5.360.0070.05020.40
5.5.350.0070.09020.41
5.5.340.0170.07321.00
5.5.330.0100.05020.93
5.5.320.0030.04320.93
5.5.310.0100.05020.96
5.5.300.0200.06720.86
5.5.290.0070.08320.82
5.5.280.0030.09320.88
5.5.270.0070.08020.86
5.5.260.0200.04020.79
5.5.250.0000.06320.81
5.5.240.0000.06320.34
5.5.230.0030.05320.27
5.5.220.0030.04320.18
5.5.210.0100.03320.36
5.5.200.0100.07720.30
5.5.190.0070.07720.34
5.5.180.0030.04320.21
5.5.160.0030.04720.32
5.5.150.0100.05720.25
5.5.140.0070.04720.05
5.5.130.0130.06020.24
5.5.120.0100.04320.29
5.5.110.0100.07320.24
5.5.100.0100.08020.08
5.5.90.0100.04020.10
5.5.80.0170.03720.21
5.5.70.0030.05020.10
5.5.60.0170.07020.15
5.5.50.0130.07020.22
5.5.40.0030.08020.06
5.5.30.0030.06320.02
5.5.20.0100.06320.14
5.5.10.0100.07720.04
5.5.00.0030.06720.06
5.4.450.0130.06019.39
5.4.440.0100.07319.36
5.4.430.0030.08019.31
5.4.420.0200.07019.27
5.4.410.0030.07319.02
5.4.400.0000.08319.13
5.4.390.0100.04319.05
5.4.380.0170.05718.96
5.4.370.0100.05318.98
5.4.360.0100.07019.05
5.4.350.0030.08019.03
5.4.340.0030.04019.10
5.4.320.0070.04018.79
5.4.310.0030.04719.06
5.4.300.0170.07019.06
5.4.290.0030.08319.20
5.4.280.0130.07019.13
5.4.270.0170.03719.15
5.4.260.0100.06019.06
5.4.250.0230.06018.79
5.4.240.0000.08318.82
5.4.230.0030.07719.07
5.4.220.0130.04318.97
5.4.210.0070.05719.25
5.4.200.0000.07719.23
5.4.190.0070.04019.00
5.4.180.0000.07019.07
5.4.170.0070.06319.04
5.4.160.0170.06318.93
5.4.150.0070.05319.21
5.4.140.0100.03016.27
5.4.130.0030.04316.26
5.4.120.0030.06016.27
5.4.110.0070.07716.32
5.4.100.0070.04016.36
5.4.90.0100.06016.33
5.4.80.0070.04016.40
5.4.70.0030.04016.30
5.4.60.0070.07716.26
5.4.50.0070.06316.20
5.4.40.0130.05016.45
5.4.30.0070.03716.36
5.4.20.0070.04016.27
5.4.10.0070.06316.47
5.4.00.0030.07315.80
5.3.290.0070.04014.56
5.3.280.0100.07314.60
5.3.270.0100.07014.54
5.3.260.0100.07314.67
5.3.250.0000.05014.66
5.3.240.0070.07014.66
5.3.230.0000.05014.67
5.3.220.0030.07014.64
5.3.210.0100.04014.46
5.3.200.0070.05014.61
5.3.190.0130.07014.59
5.3.180.0000.05014.49
5.3.170.0030.04714.50
5.3.160.0070.06714.64
5.3.150.0070.07314.63
5.3.140.0100.04714.63
5.3.130.0130.07014.46
5.3.120.0070.07714.62
5.3.110.0070.07714.48
5.3.100.0070.05313.93
5.3.90.0000.04014.06
5.3.80.0030.05714.10
5.3.70.0070.03313.95
5.3.60.0030.07314.08
5.3.50.0030.06713.88
5.3.40.0070.07013.99
5.3.30.0100.06713.93
5.3.20.0030.05013.75
5.3.10.0000.06313.71
5.3.00.0070.07713.72

preferences:
42.73 ms | 401 KiB | 5 Q