3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 1 => [ 'categoryName'=>'Main One', 'title'=>'Title one', 'date'=>'2019-09-01', 'score'=>2500 ], 2 => [ 'categoryName'=>'Main One', 'title'=>'Title two', 'date'=>'2019-09-02', 'score'=>3000 ], 3 => [ 'categoryName'=>'Main Two', 'title'=>'Other title', 'date'=>'2019-09-02', 'score'=>2100 ], 4 => [ 'categoryName'=>'Main Three', 'title'=>'Other title', 'date'=>'2019-09-05', 'score'=>200 ], 5 => [ 'categoryName'=>'Main Three', 'title'=>'Other topic', 'date'=>'2019-09-02', 'score'=>1000 ] ]; $prevMain = ""; $currentMain = ""; $html = "<table border=1><tbody>"; foreach($array as $row): $currentMain = $row["categoryName"]; if($currentMain !== $prevMain) { $prevMain = $row["categoryName"]; $html .= '<tr>' . '<td colspan="2">' . $row['categoryName'] . '</td>' . '<td></td>' . '</tr>'; } $html .='<tr>'. '<td>'.$row['date'] .'</td>'. '<td>'.$row['title'].'</td>'. '<td>'.$row['score'] . '</td>'. '</tr>'; endforeach; $html .= "</tbody></table>"; echo $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.4.130.0100.01117.48
8.4.120.0110.00920.68
8.4.110.0100.00622.59
8.4.100.0060.00317.82
8.4.90.0050.00418.86
8.4.80.0130.00717.82
8.4.70.0120.00917.81
8.4.60.0110.00819.18
8.4.50.0070.01017.94
8.4.40.0160.00319.63
8.4.30.0130.00322.18
8.4.20.0100.01020.82
8.4.10.0040.00422.30
8.3.260.0110.00916.76
8.3.250.0090.00819.02
8.3.240.0100.00916.83
8.3.230.0090.01016.44
8.3.220.0130.00517.25
8.3.210.0100.00716.71
8.3.200.0060.00316.55
8.3.190.0130.00718.55
8.3.180.0040.00416.39
8.3.170.0150.00417.32
8.3.160.0200.00016.47
8.3.150.0040.00416.83
8.3.140.0070.00717.18
8.3.130.0080.00018.48
8.3.120.0060.00320.68
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0040.00416.63
8.3.70.0150.00616.58
8.3.60.0140.00718.31
8.3.50.0060.01017.37
8.3.40.0070.00718.79
8.3.30.0110.01118.89
8.3.20.0080.00022.83
8.3.10.0000.00823.52
8.3.00.0040.00422.57
8.2.290.0060.00222.32
8.2.280.0110.01018.42
8.2.270.0100.01017.21
8.2.260.0040.01116.68
8.2.250.0000.00816.75
8.2.240.0050.00518.81
8.2.230.0050.00522.58
8.2.220.0030.00637.54
8.2.210.0050.00326.77
8.2.200.0090.00018.29
8.2.190.0030.01616.75
8.2.180.0120.00325.92
8.2.170.0040.01118.93
8.2.160.0140.00020.43
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0120.00326.16
8.2.110.0050.00519.23
8.2.100.0040.00818.03
8.2.90.0000.00817.84
8.2.80.0000.00818.05
8.2.70.0030.00518.05
8.2.60.0030.00618.34
8.2.50.0050.00318.10
8.2.40.0050.00521.10
8.2.30.0000.00719.44
8.2.20.0070.00018.26
8.2.10.0080.00019.25
8.2.00.0000.00719.32
8.1.330.0140.00521.88
8.1.320.0120.00616.25
8.1.310.0070.01018.68
8.1.300.0060.00318.40
8.1.290.0000.00930.84
8.1.280.0070.01525.92
8.1.270.0080.00020.38
8.1.260.0000.00726.35
8.1.250.0030.00628.09
8.1.240.0060.00323.90
8.1.230.0110.00020.83
8.1.220.0000.00817.79
8.1.210.0000.00818.92
8.1.200.0000.00917.22
8.1.190.0060.00317.22
8.1.180.0080.00018.10
8.1.170.0060.00320.50
8.1.160.0040.00419.06
8.1.150.0020.00518.97
8.1.140.0030.00618.95
8.1.130.0000.00720.12
8.1.120.0030.00517.41
8.1.110.0020.00517.36
8.1.100.0050.00217.45
8.1.90.0040.00417.52
8.1.80.0090.00017.37
8.1.70.0040.00417.48
8.1.60.0050.00217.44
8.1.50.0050.00217.51
8.1.40.0000.00817.53
8.1.30.0030.00617.63
8.1.20.0090.00317.61
8.1.10.0000.00717.62
8.1.00.0080.00417.55
8.0.300.0070.00020.01
8.0.290.0040.00416.63
8.0.280.0000.00818.38
8.0.270.0070.00017.30
8.0.260.0030.00320.08
8.0.250.0070.00017.02
8.0.240.0030.00316.98
8.0.230.0070.00016.98
8.0.220.0030.00316.91
8.0.210.0000.00816.78
8.0.200.0030.00316.91
8.0.190.0000.00817.05
8.0.180.0000.00716.97
8.0.170.0030.00916.90
8.0.160.0000.00716.93
8.0.150.0000.00716.83
8.0.140.0000.00716.85
8.0.130.0060.00013.38
8.0.120.0040.00416.88
8.0.110.0020.00516.98
8.0.100.0070.00017.03
8.0.90.0030.00616.77
8.0.80.0120.00916.85
8.0.70.0080.00016.93
8.0.60.0000.00716.86
8.0.50.0040.00416.98
8.0.30.0070.01317.00
8.0.20.0030.01617.07
8.0.10.0040.00417.07
8.0.00.0070.01016.98
7.4.330.0000.00415.55
7.4.320.0030.00316.68
7.4.300.0030.00316.58
7.4.290.0050.00316.63
7.4.280.0000.00816.50
7.4.270.0000.00716.54
7.4.260.0000.00613.29
7.4.250.0040.00416.55
7.4.240.0020.00516.62
7.4.230.0030.00316.42
7.4.220.0020.00516.42
7.4.210.0040.01016.59
7.4.200.0030.00316.65
7.4.140.0040.01517.86
7.4.130.0110.00716.61
7.4.120.0090.00916.43
7.4.110.0060.01216.38
7.4.100.0050.01416.34
7.4.90.0090.00916.59
7.4.80.0140.00719.39
7.4.70.0090.00916.36
7.4.60.0130.00316.52
7.4.50.0000.01416.69
7.4.40.0220.00016.39
7.4.00.0100.00615.04
7.3.330.0050.00216.15
7.3.320.0060.00013.11
7.3.310.0000.00716.41
7.3.300.0040.00416.29
7.3.290.0000.00716.40
7.3.260.0120.00616.38
7.3.240.0110.00816.46
7.3.230.0110.00516.59
7.3.210.0140.00716.49
7.3.200.0030.01216.30
7.3.190.0190.00316.28
7.3.180.0090.00616.47
7.3.170.0080.00816.29
7.3.160.0080.00816.53
7.3.100.0060.00914.79
7.3.90.0030.01514.63
7.3.80.0030.01014.55
7.3.70.0040.01714.83
7.3.60.0060.00914.88
7.3.50.0170.00314.76
7.3.40.0100.01014.70
7.3.30.0030.00914.41
7.3.20.0120.00914.93
7.3.10.0070.00714.88
7.3.00.0520.00614.78
7.2.330.0110.00816.65
7.2.320.0040.01616.72
7.2.310.0040.01216.63
7.2.300.0030.01416.69
7.2.290.0110.00816.70
7.2.230.0080.00714.98
7.2.220.0090.00614.80
7.2.210.0090.00615.20
7.2.200.0070.00715.13
7.2.190.0120.00914.93
7.2.180.0190.00415.27
7.2.170.0060.00915.16
7.2.160.0060.01115.17
7.2.150.0090.01214.84
7.2.140.0140.01015.17
7.2.130.0110.01215.30
7.2.120.0080.00815.16
7.2.110.0060.01215.11
7.2.100.0110.00514.86
7.2.90.0060.01815.14
7.2.80.0090.01415.26
7.2.70.0150.00415.16
7.2.60.0100.00715.18
7.2.50.0130.00315.10
7.2.40.0130.00915.19
7.2.30.0070.01015.05
7.2.20.0070.01415.07
7.2.10.0100.01315.17
7.2.00.0100.00915.02
7.1.320.0150.00013.98
7.1.310.0130.00913.94
7.1.300.0120.00913.98
7.1.290.0140.00614.00
7.1.280.0030.01213.76
7.1.270.0120.00813.72
7.1.260.0000.01914.11
7.1.250.0060.00913.98

preferences:
131.78 ms | 403 KiB | 5 Q