3v4l.org

run code in 300+ PHP versions simultaneously
<?php class tableutils{ static function compareByName($a, $b){ return strcmp($a, $b); } static function tabella_riassunto ($valori,$cell1,$sort=true,$arr=false,$className='tabella_riassunto',$tot_righe=true,$classi="",$links=""){ /* Scorro l'array per trovare tutte le colonne possibili * TODO: esiste un modo piĆ¹ elegante? */ foreach ($valori as $key => $val) { foreach ($val as $kr => $vr) $col[$kr] = $kr; } if($sort) { sort($col); uksort($valori, 'tableutils::compareByName'); } /* Inizio a scrivere la tabella*/ $table="<table class=\"$className\" celpadding=\"0\" cellspacing=\"0\">"; /* Scrivo le intestazioni */ $table .="<tr>"; $table .="<th>$cell1</th>"; $rex[0][] = $cell1; /* Scrivo le intestazioni */ foreach ($col as $c) { $table .="<th>".$c."</th>";$rex[0][] = $c; } /* Questa colonna serve per i totali */ if($tot_righe) $table .="<th>TOTALE</th>"; //else $table .="<th></th>"; $table .="</tr>"; if($tot_righe)$rex[0][] = "TOTALE"; /* Ciclo l'array*/ $count = 1; foreach ($valori as $key => $val) { $tot1=0; $table .="<tr>"; $table .="<td class=\"nomi\">".$key."</td>"; $rex[$count][] = $key; $count_col=1; foreach ($col as $c){ if(is_array(links)){ if($links[$key][$c]){ if($classi[$count_col]) $table .="<td class=\"".$classi[$count_col]."\"><a href='".$links[$key][$c]."'>".$val[$c]."</a></td>"; else $table .="<td><a href='".$links[$key][$c]."'>".$val[$c]."</a></td>"; } else { if($classi[$count_col]) $table .="<td class=\"".$classi[$count_col]."\">".$val[$c]."</td>"; else $table .="<td>".$val[$c]."</td>"; } } $rex[$count][] = $val[$c]; /* Faccio la somma dei valori degli elementi della riga */ $tot1 += $val[$c]; /* Faccio la somma usando come indice il nome della colonna */ $tot2[$c] += $val[$c]; $count_col++; } if($tot_righe){ $table .="<td class=\"tot1\">".$tot1."</td>"; //else $table .="<td class=\"tot1\"></td>"; $rex[$count][] = $tot1; } $table .="</tr>"; $count++; } /* Scrivo la somma salvata precedentemente*/ $table .="<tr>"; $table .="<td class=\"tot1\">TOTALE</td>"; $rex[$count][] = "TOTALE"; foreach ($tot2 as $t){ $table .="<td class=\"tot1\">".$t."</td>"; $rex[$count][] = $t; $tot += $t; } if($tot_righe){ $table .="<td class=\"totfinal\">".$tot."</td>"; $rex[$count][] = $tot; } $table .="</tr>"; $table .="</table>"; if($arr) return $rex; else return $table; } } $arr = array("052 VARICELLA" => array("2015 m focolai" => 1, "2015 casi coinvolti" => 3)); tableutils::tabella_riassunto($arr);

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.0160.00018.56
8.3.50.0110.00722.00
8.3.40.0120.00318.96
8.3.30.0110.00319.02
8.3.20.0060.00320.35
8.3.10.0080.00023.66
8.3.00.0000.00819.20
8.2.180.0110.00716.63
8.2.170.0120.00622.96
8.2.160.0000.01320.47
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0110.00426.16
8.2.120.0040.00419.54
8.2.110.0070.00322.27
8.2.100.0030.00917.78
8.2.90.0030.00617.75
8.2.80.0000.00817.97
8.2.70.0040.00418.04
8.2.60.0050.00318.09
8.2.50.0040.00418.10
8.2.40.0040.00420.68
8.2.30.0000.00819.33
8.2.20.0020.00517.66
8.2.10.0030.00517.99
8.2.00.0000.00717.87
8.1.280.0100.00725.92
8.1.270.0030.00618.95
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00320.64
8.1.230.0040.00719.16
8.1.220.0030.00517.74
8.1.210.0030.00618.77
8.1.200.0100.00017.25
8.1.190.0040.00417.22
8.1.180.0000.00818.10
8.1.170.0040.00418.58
8.1.160.0040.00418.79
8.1.150.0050.00218.80
8.1.140.0000.00817.43
8.1.130.0040.00417.92
8.1.120.0000.00717.49
8.1.110.0000.00717.41
8.1.100.0000.00717.36
8.1.90.0040.00417.43
8.1.80.0000.00717.51
8.1.70.0030.00617.43
8.1.60.0030.00517.67
8.1.50.0050.00317.51
8.1.40.0030.00617.47
8.1.30.0030.00517.67
8.1.20.0000.00717.54
8.1.10.0040.00417.63
8.1.00.0040.00417.45
8.0.300.0060.00319.75
8.0.290.0000.00816.75
8.0.280.0000.00718.29
8.0.270.0070.00017.14
8.0.260.0070.00017.31
8.0.250.0070.00016.91
8.0.240.0070.00316.90
8.0.230.0030.00317.01
8.0.220.0000.00716.99
8.0.210.0000.00716.91
8.0.200.0030.00316.91
8.0.190.0030.00517.00
8.0.180.0070.00016.86
8.0.170.0040.00417.02
8.0.160.0030.00316.99
8.0.150.0070.00416.95
8.0.140.0030.00416.93
8.0.130.0000.00613.39
8.0.120.0000.00816.96
8.0.110.0020.00517.02
8.0.100.0040.00417.00
8.0.90.0040.00416.98
8.0.80.0120.00916.86
8.0.70.0000.00716.80
8.0.60.0040.00416.82
8.0.50.0080.00016.83
8.0.30.0060.01217.02
8.0.20.0110.00917.40
8.0.10.0000.00716.94
8.0.00.0100.01016.84
7.4.330.0020.00215.05
7.4.320.0060.00016.52
7.4.300.0030.00316.50
7.4.290.0030.00316.55
7.4.280.0070.00016.59
7.4.270.0070.00016.66
7.4.260.0080.00016.44
7.4.250.0030.00516.66
7.4.240.0020.00516.66
7.4.230.0000.00816.56
7.4.220.0170.00716.76
7.4.210.0030.01016.61
7.4.200.0040.00416.49
7.4.160.0100.00616.56
7.4.150.0100.01017.40
7.4.140.0110.00617.86
7.4.130.0090.00916.54
7.4.120.0070.01216.54
7.4.110.0120.01216.52
7.4.100.0090.00916.77
7.4.90.0090.00916.54
7.4.80.0100.01319.39
7.4.70.0120.00416.43
7.4.60.0080.01016.54
7.4.50.0100.00416.60
7.4.40.0120.00416.21
7.4.30.0070.01116.41
7.4.20.0040.01216.01
7.4.10.0070.01016.24
7.4.00.0080.00615.95
7.3.330.0050.00013.41
7.3.320.0050.00013.41
7.3.310.0020.00516.43
7.3.300.0000.00816.40
7.3.290.0060.01116.38
7.3.280.0100.00716.41
7.3.270.0150.00317.40
7.3.260.0140.00316.68
7.3.250.0090.00916.37
7.3.240.0090.00916.61
7.3.230.0070.01016.65
7.3.210.0140.00316.57
7.3.200.0100.00719.39
7.3.190.0040.01516.46
7.3.180.0070.01216.36
7.3.170.0070.01016.29
7.3.160.0030.01316.42
7.3.150.0060.01216.11
7.3.140.0160.00016.28
7.3.130.0160.00316.21
7.3.120.0100.01016.48
7.3.110.0090.00616.45
7.3.100.0030.01216.16
7.3.90.0120.00316.29
7.3.80.0040.01216.07
7.3.70.0030.01216.26
7.3.60.0060.00916.35
7.3.50.0040.01116.34
7.3.40.0050.01116.29
7.3.30.0170.00316.43
7.3.20.0110.00716.06
7.3.10.0100.00716.26
7.3.00.0120.00616.18
7.2.330.0150.00316.53
7.2.320.0150.00416.34
7.2.310.0100.00816.39
7.2.300.0160.00016.42
7.2.290.0080.01216.42
7.2.280.0080.00816.54
7.2.270.0080.00816.30
7.2.260.0090.00616.39
7.2.250.0070.01316.50
7.2.240.0120.00416.34
7.2.230.0030.01216.30
7.2.220.0060.00916.27
7.2.210.0000.01616.46
7.2.200.0090.00616.39
7.2.190.0030.01316.20
7.2.180.0000.01716.38
7.2.170.0080.01116.40
7.2.160.0060.00916.46
7.2.150.0100.00616.51
7.2.140.0150.01216.59
7.2.130.0090.00916.43
7.2.120.0080.01016.38
7.2.110.0110.00916.38
7.2.100.0080.01216.48
7.2.90.0090.01116.47
7.2.80.0040.01116.49
7.2.70.0100.00716.49
7.2.60.0070.00716.53
7.2.50.0100.00816.60
7.2.40.0070.01016.39
7.2.30.0100.00816.53
7.2.20.0100.01016.46
7.2.10.0050.01116.46
7.2.00.0090.00516.39
7.1.330.0150.00015.48
7.1.320.0030.01315.27
7.1.310.0030.01215.29
7.1.300.0120.00315.44
7.1.290.0110.00615.20
7.1.280.0100.00715.53
7.1.270.0090.00615.45
7.1.260.0030.01315.49
7.1.250.0120.00615.38
7.1.240.0100.01015.25
7.1.230.0090.00615.45
7.1.220.0110.00515.37
7.1.210.0110.00415.38
7.1.200.0090.00615.50
7.1.190.0060.00915.20
7.1.180.0060.00915.43
7.1.170.0060.01215.27
7.1.160.0090.00615.48
7.1.150.0170.00315.39
7.1.140.0120.00615.31
7.1.130.0030.01315.27
7.1.120.0060.00915.46
7.1.110.0030.01215.39
7.1.100.0090.00516.77
7.1.90.0120.00315.38
7.1.80.0070.01015.39
7.1.70.0050.00716.04
7.1.60.0110.00817.44
7.1.50.0120.01525.03
7.1.40.0070.01015.39
7.1.30.0000.01615.25
7.1.20.0000.01715.46
7.1.10.0120.00315.52
7.1.00.0050.04318.89
7.0.330.0080.00815.10
7.0.320.0090.00615.15
7.0.310.0090.00615.20
7.0.300.0140.00015.21
7.0.290.0040.01115.34
7.0.280.0060.00915.23
7.0.270.0030.01315.16
7.0.260.0040.01215.12
7.0.250.0130.00315.46
7.0.240.0060.01015.26
7.0.230.0120.00915.23
7.0.220.0030.01315.31
7.0.210.0060.00915.41
7.0.200.0060.00716.09
7.0.190.0060.01315.18
7.0.180.0150.00415.18
7.0.170.0130.00715.29
7.0.160.0130.00814.88
7.0.150.0070.00715.25
7.0.140.0050.03318.63
7.0.130.0110.00415.10
7.0.120.0110.00515.42
7.0.110.0070.00715.00
7.0.100.0040.01515.11
7.0.90.0040.01115.11
7.0.80.0110.00414.94
7.0.70.0070.00715.19
7.0.60.0050.04618.41
7.0.50.0090.04316.52
7.0.40.0090.04717.57
7.0.30.0130.02717.78
7.0.20.0210.04517.55
7.0.10.0080.04717.63
7.0.00.0120.04317.65
5.6.400.0090.00915.96
5.6.390.0030.01615.95
5.6.380.0090.00915.74
5.6.370.0070.01015.87
5.6.360.0120.00616.11
5.6.350.0060.01315.91
5.6.340.0120.00816.01
5.6.330.0130.00616.04
5.6.320.0060.01615.91
5.6.310.0120.00615.82
5.6.300.0100.00716.07
5.6.290.0070.01015.88
5.6.280.0080.03618.59
5.6.270.0170.00016.07
5.6.260.0030.01415.89
5.6.250.0090.00915.90
5.6.240.0130.00416.02
5.6.230.0070.01016.06
5.6.220.0070.01016.06
5.6.210.0050.02518.28
5.6.200.0120.04017.11
5.6.190.0080.04518.33
5.6.180.0210.02618.22
5.6.170.0130.03118.15
5.6.160.0100.02818.21
5.6.150.0060.02516.95
5.6.140.0070.03017.12
5.6.130.0060.02616.99
5.6.120.0030.03918.52
5.6.110.0100.04218.54
5.6.100.0020.02918.55
5.6.90.0100.04318.44
5.6.80.0060.04218.13
5.6.70.0060.01216.01
5.6.60.0070.01115.89
5.6.50.0060.01615.82
5.6.40.0120.00615.75
5.6.30.0140.00515.91
5.6.20.0100.00915.67
5.6.10.0100.00715.59
5.6.00.0040.01215.82
5.5.380.0150.00315.68
5.5.370.0030.01416.01
5.5.360.0120.00615.90
5.5.350.0180.04018.07
5.5.340.0060.02416.95
5.5.330.0150.03817.98
5.5.320.0100.03718.11
5.5.310.0110.02718.18
5.5.300.0090.03616.87
5.5.290.0080.04817.01
5.5.280.0080.04818.26
5.5.270.0100.04518.31
5.5.260.0110.04318.39
5.5.250.0060.02518.27
5.5.240.0150.04318.07
5.5.230.0030.01415.94
5.5.220.0090.00915.95
5.5.210.0080.01415.72
5.5.200.0090.00915.81
5.5.190.0060.01315.96
5.5.180.0060.01215.57
5.5.170.0070.01015.86
5.5.160.0030.01316.01
5.5.150.0070.01015.82
5.5.140.0100.00715.91
5.5.130.0060.01215.74
5.5.120.0040.01416.06
5.5.110.0030.01315.84
5.5.100.0100.00715.94
5.5.90.0100.00715.56
5.5.80.0040.01416.08
5.5.70.0090.00915.93
5.5.60.0000.02215.93
5.5.50.0060.01115.58
5.5.40.0060.01215.96
5.5.30.0090.00915.89
5.5.20.0090.00915.73
5.5.10.0170.00015.79
5.5.00.0110.00615.86
5.4.450.0330.03016.07
5.4.440.0550.03016.13
5.4.430.0470.03116.03
5.4.420.0540.02916.03
5.4.410.0480.03115.88
5.4.400.0520.03315.97
5.4.390.0620.02515.99
5.4.380.0100.03615.58
5.4.370.0130.03015.60
5.4.360.0080.03315.56
5.4.350.0170.03515.76
5.4.340.0100.03015.78
5.4.330.0100.00312.75
5.4.320.0080.03515.67
5.4.310.0130.03015.57
5.4.300.0080.03515.66
5.4.290.0070.03715.56
5.4.280.0120.03715.70
5.4.270.0070.03615.63
5.4.260.0100.03315.72
5.4.250.0150.04015.64
5.4.240.0150.04015.74
5.4.230.0150.03315.76
5.4.220.0100.03515.81
5.4.210.0150.02615.71
5.4.200.0150.02614.66
5.4.190.0120.03015.59
5.4.180.0120.03215.65
5.4.170.0080.03315.56
5.4.160.0160.03815.71
5.4.150.0130.02815.71
5.4.140.0150.04014.51
5.4.130.0150.03514.45
5.4.120.0120.03514.46
5.4.110.0150.02814.46
5.4.100.0160.02414.39
5.4.90.0130.02714.48
5.4.80.0130.03514.45
5.4.70.0080.03714.43
5.4.60.0130.03014.47
5.4.50.0070.03114.47
5.4.40.0130.03814.41
5.4.30.0150.03514.46
5.4.20.0110.04014.52
5.4.10.0210.02814.60
5.4.00.0120.02714.28
5.3.290.0110.03414.00
5.3.280.0160.02513.85
5.3.270.0100.03213.91
5.3.260.0130.03013.99
5.3.250.0170.02613.95
5.3.240.0210.03313.95
5.3.230.0150.03113.93
5.3.220.0230.02313.83
5.3.210.0130.03013.90
5.3.200.0070.03713.91
5.3.190.0160.04513.99
5.3.180.0200.02314.03
5.3.170.0090.03114.05
5.3.160.0080.03713.99
5.3.150.0130.02813.94
5.3.140.0150.02513.90
5.3.130.0100.03313.89
5.3.120.0130.02813.96
5.3.110.0120.03513.93
5.3.100.0030.04213.73
5.3.90.0150.02713.82
5.3.80.0080.03413.67
5.3.70.0090.03213.72
5.3.60.0070.03713.66
5.3.50.0110.02913.70
5.3.40.0070.03313.57
5.3.30.0070.04313.52
5.3.20.0090.03413.38
5.3.10.0160.02813.27
5.3.00.0080.03313.23
5.2.170.0080.02611.71
5.2.160.0060.02611.65
5.2.150.0100.02411.66
5.2.140.0090.02511.61
5.2.130.0110.02611.66
5.2.120.0070.02711.67
5.2.110.0060.02611.67
5.2.100.0080.02511.60
5.2.90.0120.01811.68
5.2.80.0030.02911.60
5.2.70.0080.02511.65
5.2.60.0070.03611.59
5.2.50.0130.03011.53
5.2.40.0020.03711.53
5.2.30.0090.03011.64
5.2.20.0110.02811.41
5.2.10.0130.02311.32
5.2.00.0090.02511.21
5.1.60.0080.02310.70
5.1.50.0050.02610.65
5.1.40.0100.01910.53
5.1.30.0110.01810.87
5.1.20.0090.02010.84
5.1.10.0100.01910.68
5.1.00.0100.02010.61
5.0.50.0060.0189.51
5.0.40.0090.0139.51
5.0.30.0030.0279.39
5.0.20.0070.0159.36
5.0.10.0050.0189.31
5.0.00.0070.0239.30
4.4.90.0020.0168.12
4.4.80.0080.0088.11
4.4.70.0050.0138.12
4.4.60.0060.0128.11
4.4.50.0020.0158.18
4.4.40.0030.0218.11
4.4.30.0070.0138.13
4.4.20.0030.0128.18
4.4.10.0050.0118.13
4.4.00.0050.0238.14
4.3.110.0020.0198.08
4.3.100.0030.0188.10
4.3.90.0050.0118.08
4.3.80.0070.0228.06
4.3.70.0070.0138.06
4.3.60.0030.0178.08
4.3.50.0060.0158.06
4.3.40.0070.0228.05
4.3.30.0000.0197.44
4.3.20.0020.0167.49
4.3.10.0060.0107.45
4.3.00.0050.0159.90

preferences:
59.67 ms | 401 KiB | 5 Q