3v4l.org

run code in 300+ PHP versions simultaneously
<?php $borders = [20,40,60,80]; // some test data $rows[] = ["Rpa" => 30, "Rpb" => 14, "Rpc" => 1, "Rpd" => 24]; $rows[] = ["Rpa" => 41, "Rpb" => 33, "Rpc" => 20, "Rpd" => 79]; $grouprows = []; // we'll need some array to re-structure your rows. foreach($rows as $row) { // this is your while($row = $result->fetch_assoc()) $groups = []; // the former columns will be packed into "groups" (1-20, 21-40,..) foreach($row as $column => $value) { foreach($borders as $i => $border) { // check where the value fits in if($value <= $border) { $groups[$border][] = "$column: $value"; break; } } ksort($groups); // sort the groups to be ascending } $grouprows[] = $groups; } // actual output echo "<table border=1> <tr> <th>1-20</th> <th>21-40</th> <th>41-60</th> <th>61-80</th> <th>81-100</th> </tr>\n"; foreach($grouprows as $row) { echo "<tr>\n"; $colcount = 0; foreach($row as $col) { if(is_array($col)) { echo "\t<td>" . implode(",",$col) . "</td>\n"; } else { echo "\t<td></td>\n"; } $colcount++; } for($colcount;$colcount<count($borders);$colcount++) { echo "\t<td></td>\n"; } echo "</tr>\n"; } echo "</table>";

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.5.10.0110.00716.81
8.5.00.0130.00920.04
8.4.150.0010.00214.05
8.4.140.0120.00917.38
8.4.130.0100.00918.43
8.4.120.0110.00824.10
8.4.110.0130.00718.95
8.4.100.0110.00818.88
8.4.90.0130.00920.50
8.4.80.0080.00218.73
8.4.70.0130.01118.05
8.4.60.0040.00519.14
8.4.50.0120.00818.65
8.4.40.0040.00717.75
8.4.30.0070.00317.54
8.4.20.0060.00318.59
8.4.10.0100.01017.46
8.3.280.0140.00718.43
8.3.270.0130.00716.67
8.3.260.0120.01016.41
8.3.250.0140.00418.86
8.3.240.0120.00617.12
8.3.230.0130.00616.73
8.3.220.0080.01119.18
8.3.210.0120.00816.52
8.3.200.0040.00516.62
8.3.190.0090.00918.91
8.3.180.0040.00417.22
8.3.170.0000.00818.92
8.3.160.0130.00016.26
8.3.150.0000.02018.40
8.3.140.0040.00418.79
8.3.130.0060.00318.58
8.3.120.0060.00319.00
8.3.110.0060.00320.94
8.3.100.0030.00624.06
8.3.90.0110.00426.77
8.3.80.0090.00017.97
8.3.70.0100.00618.71
8.3.60.0120.00618.56
8.3.50.0070.01017.31
8.3.40.0000.01518.79
8.3.30.0090.00618.55
8.3.20.0080.00018.90
8.3.10.0080.00021.77
8.3.00.0040.00423.66
8.2.290.0080.00320.50
8.2.280.0100.01018.54
8.2.270.0120.00617.21
8.2.260.0100.00717.29
8.2.250.0090.00016.68
8.2.240.0090.00017.21
8.2.230.0050.00322.58
8.2.220.0030.00737.54
8.2.210.0110.00326.77
8.2.200.0070.00716.63
8.2.190.0090.00618.35
8.2.180.0120.00316.38
8.2.170.0030.01022.96
8.2.160.0070.00719.07
8.2.150.0050.00325.66
8.2.140.0060.00324.66
8.2.130.0030.00626.16
8.2.120.0030.00621.08
8.2.110.0040.00420.53
8.2.100.0080.00317.84
8.2.90.0040.00719.09
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0000.00718.35
8.2.30.0000.00718.08
8.2.20.0060.00318.02
8.2.10.0040.00418.17
8.2.00.0000.00818.11
8.1.330.0120.00821.98
8.1.320.0140.00718.09
8.1.310.0080.00018.24
8.1.300.0080.00317.69
8.1.290.0050.00530.84
8.1.280.0130.00725.92
8.1.270.0060.00322.01
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00323.84
8.1.230.0090.00320.91
8.1.220.0050.00517.79
8.1.210.0030.00518.77
8.1.200.0040.00717.36
8.1.190.0080.00017.10
8.1.180.0050.00318.10
8.1.170.0000.00918.61
8.1.160.0080.00018.95
8.1.150.0040.00418.89
8.1.140.0050.00320.68
8.1.130.0000.00720.32
8.1.120.0040.00417.36
8.1.110.0040.00417.49
8.1.100.0050.00317.28
8.1.90.0000.00717.44
8.1.80.0000.00817.39
8.1.70.0030.00617.50
8.1.60.0040.00417.57
8.1.50.0040.00417.52
8.1.40.0080.00017.45
8.1.30.0050.00317.63
8.1.20.0000.00717.63
8.1.10.0040.00417.50
8.1.00.0050.00217.36
8.0.300.0040.00420.04
8.0.290.0000.00716.75
8.0.280.0070.00018.48
8.0.270.0040.00417.26
8.0.260.0030.00320.12
8.0.250.0000.00716.94
8.0.240.0000.00716.84
8.0.230.0040.00416.95
8.0.220.0000.00716.81
8.0.210.0040.00416.80
8.0.200.0000.00716.98
8.0.190.0030.00516.85
8.0.180.0080.00016.81
8.0.170.0030.00516.92
8.0.160.0040.00416.91
8.0.150.0000.01016.73
8.0.140.0080.00016.87
8.0.130.0060.00013.38
8.0.120.0040.00416.87
8.0.110.0070.00016.94
8.0.100.0050.00316.90
8.0.90.0010.00716.95
8.0.80.0080.00816.85
8.0.70.0050.00216.96
8.0.60.0000.00716.85
8.0.50.0050.00316.77
8.0.30.0140.00317.06
8.0.20.0110.00917.40
8.0.10.0040.00417.08
8.0.00.0150.00616.84
7.4.330.0000.00515.55
7.4.320.0030.00316.60
7.4.300.0000.00616.48
7.4.290.0050.00316.59
7.4.280.0040.00416.55
7.4.270.0070.00016.43
7.4.260.0020.00816.55
7.4.250.0040.00416.58
7.4.240.0080.00016.47
7.4.230.0000.00716.61
7.4.220.0000.00716.34
7.4.210.0030.01316.51
7.4.200.0040.00416.59
7.4.160.0120.00716.49
7.4.140.0110.00817.86
7.4.130.0140.01416.61
7.4.120.0090.00916.53
7.4.110.0160.01216.46
7.4.100.0140.01016.61
7.4.90.0140.00616.66
7.4.80.0120.01219.39
7.4.70.0000.01616.63
7.4.60.0100.01016.29
7.4.50.0030.01216.43
7.4.40.0100.00716.46
7.4.00.0090.00914.88
7.3.330.0000.00513.10
7.3.320.0060.00013.28
7.3.310.0000.00716.27
7.3.300.0030.00316.33
7.3.290.0030.00316.25
7.3.280.0070.00816.36
7.3.260.0060.01416.46
7.3.240.0070.01116.37
7.3.230.0110.01116.40
7.3.210.0060.01616.24
7.3.200.0130.00416.71
7.3.190.0060.01016.32
7.3.180.0070.01016.49
7.3.170.0100.00716.74
7.3.160.0130.00416.50
7.3.120.0100.01014.88
7.3.110.0030.01314.99
7.3.100.0030.00914.93
7.3.90.0050.00814.66
7.3.80.0110.00414.90
7.3.70.0070.00714.83
7.3.60.0050.01014.69
7.3.50.0050.00814.80
7.3.40.0000.01414.84
7.3.30.0080.00714.82
7.3.20.0070.01115.72
7.3.10.0050.01016.02
7.3.00.0070.00515.94
7.2.330.0150.00616.52
7.2.320.0090.00916.81
7.2.310.0160.00716.70
7.2.300.0120.00616.71
7.2.290.0080.01116.69
7.2.250.0100.00715.07
7.2.240.0140.00715.15
7.2.230.0100.00415.01
7.2.220.0050.01015.19
7.2.210.0050.00914.91
7.2.200.0110.00615.02
7.2.190.0110.00515.05
7.2.180.0080.00814.96
7.2.170.0110.00615.00
7.2.160.0130.00314.88
7.2.150.0030.01715.09
7.2.140.0120.00615.12
7.2.130.0070.00915.97
7.2.120.0080.00715.93
7.2.110.0060.00915.72
7.2.100.0670.00615.53
7.2.90.0750.00215.62
7.2.80.0700.01215.64
7.2.70.0790.00815.54
7.2.60.0700.00515.56
7.2.50.0690.00315.55
7.2.40.0960.00715.61
7.2.30.0460.00915.63
7.2.20.0520.00815.67
7.2.10.0740.00715.65
7.2.00.0830.00715.67
7.1.330.0030.01415.66
7.1.320.0020.01314.85
7.1.310.0130.00415.12
7.1.300.0030.00914.89
7.1.290.0110.00514.88
7.1.280.0080.00814.82
7.1.270.0090.00914.90
7.1.260.0090.00914.93
7.1.250.0060.00814.66
7.1.240.0060.00913.93
7.1.230.0070.00713.79
7.1.220.0900.00913.96
7.1.210.0890.00513.93
7.1.200.1370.00513.79
7.1.190.1010.00513.86
7.1.180.1410.00513.79
7.1.170.1000.00613.88
7.1.160.0650.00713.65
7.1.150.1030.00413.65
7.1.140.0890.00613.77
7.1.130.1080.00913.75
7.1.120.1370.00613.91
7.1.110.1350.00913.79
7.1.100.1480.00513.70
7.1.90.1360.00613.93
7.1.80.1900.00513.89
7.1.70.1370.00613.92
7.1.60.1330.00622.63
7.1.50.1440.01622.62
7.1.40.1880.00822.80
7.1.30.1480.01422.80
7.1.20.1990.01122.86
7.1.10.2090.00913.80
7.1.00.1510.00813.89
7.0.330.0110.00413.77
7.0.320.0030.00913.52
7.0.310.0040.00813.25
7.0.300.0060.00613.26
7.0.290.0130.00013.50
7.0.280.0650.00513.53
7.0.270.0080.00513.62
7.0.260.0100.00313.47
7.0.250.0090.00613.62
7.0.240.0120.00313.64
7.0.230.0000.01713.34
7.0.220.0120.00313.33
7.0.210.0220.00713.31
7.0.200.0070.01413.42
7.0.190.0030.01013.57
7.0.180.0120.00313.41
7.0.170.0120.00613.33
7.0.160.0070.00713.54
7.0.150.0110.00313.61
7.0.140.0030.01013.38
7.0.130.0090.00913.57
7.0.120.0080.00513.25
7.0.110.0040.01213.47
7.0.100.0060.00913.46
7.0.90.0070.00713.43
7.0.80.0030.01013.52
7.0.70.0110.00413.63
7.0.60.0060.00813.37
7.0.50.0100.00913.46
7.0.40.0130.00713.78
7.0.30.0080.00813.59
7.0.20.0270.00813.60
7.0.10.0190.00813.61
7.0.00.0000.02113.66
5.6.400.0070.01114.03
5.6.390.0130.00014.31
5.6.380.0080.00714.40
5.6.370.0030.01313.97
5.6.360.0110.00314.66
5.6.350.0140.00014.42
5.6.340.0050.01014.42
5.6.330.0060.00914.57
5.6.320.0110.00314.34
5.6.310.0150.00914.32
5.6.300.0070.00714.28
5.6.290.0080.00814.38
5.6.280.0030.01314.03
5.6.270.0110.00314.38
5.6.260.0060.01013.82
5.6.250.0080.00814.15
5.6.240.0060.00914.35
5.6.230.0000.01613.99
5.6.220.0110.00814.23
5.6.210.0060.00914.20
5.6.200.0060.01214.48
5.6.190.0180.00414.31
5.6.180.0110.01014.30
5.6.170.0030.01314.36
5.6.160.0110.01114.17
5.6.150.0090.01214.26
5.6.140.0060.00914.14
5.6.130.0100.00614.39
5.6.120.0110.01114.12
5.6.110.0110.00514.21
5.6.100.0030.01314.43
5.6.90.0100.01014.03
5.6.80.0130.01014.11
5.6.70.0070.01414.38
5.6.60.0100.04014.32
5.6.50.0240.02414.17
5.6.40.0040.01514.11
5.6.30.0100.01014.41
5.6.20.0140.00314.34
5.6.10.0060.01214.28
5.6.00.0060.01314.13
5.5.380.0160.00014.49
5.5.370.0130.00314.42
5.5.360.0050.01314.20
5.5.350.0100.01014.50
5.5.340.0080.00814.50
5.5.330.0130.00914.38
5.5.320.0080.00814.58
5.5.310.0070.01014.30
5.5.300.0090.00914.62
5.5.290.0090.00614.44
5.5.280.0140.00614.47
5.5.270.0120.01214.30
5.5.260.0090.00614.31
5.5.250.0120.00614.02
5.5.240.0070.01114.50
5.5.230.0090.00614.03
5.5.220.0120.03814.48
5.5.210.0310.01914.08
5.5.200.0280.01914.46
5.5.190.0070.01114.20
5.5.180.0070.01014.14
5.5.170.0100.01014.52
5.5.160.0050.01114.39
5.5.150.0120.00914.24
5.5.140.0060.01614.43
5.5.130.0060.01214.46
5.5.120.0170.02614.47
5.5.110.0130.01014.18
5.5.100.0170.00813.91
5.5.90.0090.01414.29
5.5.80.0140.01214.16
5.5.70.0150.00514.57
5.5.60.0110.00414.26
5.5.50.0120.00914.00
5.5.40.0040.01914.17
5.5.30.0060.01214.14
5.5.20.0050.01714.46
5.5.10.0110.01314.30
5.5.00.0190.00314.28
5.4.450.0060.01210.82
5.4.440.0100.00611.16
5.4.430.0080.00810.82
5.4.420.0080.00410.44
5.4.410.0040.00911.20
5.4.400.0050.00811.08
5.4.390.0070.00810.89
5.4.380.0300.01410.97
5.4.370.0230.00311.06
5.4.360.0050.00610.96
5.4.350.0070.00710.88
5.4.340.0000.01511.00
5.4.330.0070.00710.92
5.4.320.0030.00911.06
5.4.310.0040.00710.80
5.4.300.0060.00611.02
5.4.290.0060.00610.94
5.4.280.0030.00810.79
5.4.270.0140.00411.20
5.4.260.0120.00210.79
5.4.250.0090.00911.00
5.4.240.0080.00511.18
5.4.230.0070.00711.24
5.4.220.0090.00910.95
5.4.210.0040.00811.06
5.4.200.0200.01711.05
5.4.190.0030.01410.98
5.4.180.0000.01211.27
5.4.170.0000.01611.09
5.4.160.0120.00310.75
5.4.150.0030.01311.01
5.4.140.0100.00510.81
5.4.130.0100.00711.08
5.4.120.0060.01011.04
5.4.110.0100.00510.83
5.4.100.0100.00710.95
5.4.90.0090.00510.83
5.4.80.0000.01211.01
5.4.70.0150.00311.16
5.4.60.0120.00011.02
5.4.50.0120.00311.00
5.4.40.0130.00511.00
5.4.30.0040.00811.00
5.4.20.0020.01010.90
5.4.10.0060.00610.88
5.4.00.0060.00610.85
5.3.290.0110.00410.33
5.3.280.0090.00610.17
5.3.270.0090.00610.17
5.3.260.0000.01310.18
5.3.250.0120.00610.17
5.3.240.0070.00710.17
5.3.230.0090.00610.17
5.3.220.0120.00410.17
5.3.210.0130.00210.17
5.3.200.0030.01010.17
5.3.190.0090.00210.18
5.3.180.0060.00910.18
5.3.170.0080.00410.24
5.3.160.0110.00310.34
5.3.150.0210.01210.25
5.3.140.0090.00210.17
5.3.130.0040.00710.21
5.3.120.0130.00010.17
5.3.110.0060.00610.20
5.3.100.0000.01010.22
5.3.90.0000.01210.39
5.3.80.0060.00610.17
5.3.70.0070.00410.17
5.3.60.0030.00710.17
5.3.50.0090.00010.17
5.3.40.0000.01110.17
5.3.30.0030.00810.17
5.3.20.0070.00310.17
5.3.10.0030.00710.17
5.3.00.0110.00010.17
5.2.170.0090.00010.17
5.2.160.0040.00710.17
5.2.150.0070.00410.17
5.2.140.0090.00310.17
5.2.130.0030.00810.17
5.2.120.0070.00310.17
5.2.110.0040.00510.17
5.2.100.0040.00410.17
5.2.90.0030.00710.17
5.2.80.0100.00010.17
5.2.70.0050.00610.17
5.2.60.0080.00310.17
5.2.50.0050.00510.17
5.2.40.0090.00310.17
5.2.30.0070.00310.17
5.2.20.0060.00610.17
5.2.10.0060.00610.17
5.2.00.0030.00610.17
5.1.60.0040.00810.17
5.1.50.0080.00210.17
5.1.40.0030.00810.17
5.1.30.0060.00610.17
5.1.20.0080.00010.17
5.1.10.0060.00610.17
5.1.00.0090.00310.17
5.0.50.0070.00310.17
5.0.40.0000.01010.17
5.0.30.0040.00710.17
5.0.20.0080.00510.17
5.0.10.0120.00010.17
5.0.00.0100.00010.17
4.4.90.0070.00010.17
4.4.80.0030.00510.17
4.4.70.0000.00510.17
4.4.60.0060.00010.17
4.4.50.0040.00410.17
4.4.40.0000.00810.17
4.4.30.0040.00410.17
4.4.20.0070.00010.17
4.4.10.0040.00210.17
4.4.00.0040.00410.17
4.3.110.0000.00810.17
4.3.100.0070.00210.17
4.3.90.0070.00410.17
4.3.80.0100.00010.17
4.3.70.0060.00010.17
4.3.60.0060.00310.17
4.3.50.0040.00410.17
4.3.40.0060.00010.17
4.3.30.0000.00610.17
4.3.20.0040.00410.17
4.3.10.0000.00810.17
4.3.00.0050.00210.17

preferences:
43.31 ms | 403 KiB | 5 Q