3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( 0 => array('title'=>'a', 'start_date'=>'2013/04/20', 'end_date'=>'2013/05/20'), 1 => array('title'=>'a', 'start_date'=>'2013/04/20', 'end_date'=>'2013/05/20'), 2 => array('title'=>'a', 'start_date'=>'2013/04/20', 'end_date'=>'2013/05/20'), 3 => array('title'=>'b', 'start_date'=>'2013/04/20', 'end_date'=>'2013/05/20'), 4 => array('title'=>'c', 'start_date'=>'2013/04/20', 'end_date'=>'2013/05/20'), 5 => array('title'=>'c', 'start_date'=>'2013/04/20', 'end_date'=>'2013/05/20'), ); // manipulate by array $data2 = array_group($data, 'title'); function array_group($input,$sortkey){ foreach ($input as $key=>$val) { $output[$val[$sortkey]][]=$val; } return $output; } ?> <!-- Asal --> <h1>Old</h1> <table class="table" border="1"> <tr> <td>Title</td> <td>Start Date</td> <td>End Date</td> </tr> <?php foreach($data as $k=>$v) { ?> <tr> <td><?php echo $v['title'] ?></td> <td><?php echo $v['start_date'] ?></td> <td><?php echo $v['end_date']?></td> </tr> <?php } ?> </table> <!-- Lepas dah manipulate --> <h1>Latest</h1> <table border="1"> <tr> <td>Title</td> <td>Start date</td> <td>End date</td> </tr> <?php foreach ($data2 as $key => $value): $rowspan=count($value); ?> <tr> <td rowspan="<?php echo $rowspan; ?>"><?php echo $key;?></td> <td><?php echo $value[0]['start_date']?></td> <td><?php echo $value[0]['end_date']?></td> </tr> <?php $i=1;while($i<$rowspan) { ?> <tr> <td><?php echo $value[$i]['start_date']?></td> <td><?php echo $value[$i]['end_date']?></td> </tr> <?php $i++;} ?> <?php endforeach ?> </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.3.60.0140.00418.43
8.3.50.0180.00316.34
8.3.40.0110.00718.84
8.3.30.0030.01720.17
8.3.20.0040.00420.29
8.3.10.0000.00822.08
8.3.00.0050.00322.43
8.2.180.0130.01018.29
8.2.170.0110.00422.96
8.2.160.0090.00622.30
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0020.00526.16
8.2.120.0040.00420.67
8.2.110.0040.00420.24
8.2.100.0060.00617.72
8.2.90.0050.00319.35
8.2.80.0040.00419.15
8.2.70.0030.00617.50
8.2.60.0000.00917.93
8.2.50.0030.00618.07
8.2.40.0050.00320.00
8.2.30.0020.00519.42
8.2.20.0030.00517.72
8.2.10.0000.00717.82
8.2.00.0040.00417.68
8.1.270.0000.00723.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00023.88
8.1.230.0060.00619.16
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0030.00717.39
8.1.180.0020.00719.01
8.1.170.0030.00518.55
8.1.160.0040.00420.58
8.1.150.0040.00418.63
8.1.140.0000.00817.36
8.1.130.0000.00717.78
8.1.120.0000.00717.49
8.1.110.0000.00817.39
8.1.100.0060.00317.48
8.1.90.0000.00717.34
8.1.80.0000.00817.45
8.1.70.0000.00717.42
8.1.60.0060.00317.48
8.1.50.0000.00817.47
8.1.40.0050.00217.52
8.1.30.0000.00817.46
8.1.20.0080.00017.68
8.1.10.0020.00517.54
8.1.00.0090.00317.51
8.0.300.0000.00718.77
8.0.290.0040.00417.17
8.0.280.0030.00318.30
8.0.270.0030.00317.27
8.0.260.0030.00316.83
8.0.250.0000.00716.89
8.0.240.0040.00416.83
8.0.230.0000.00716.88
8.0.220.0000.00716.77
8.0.210.0000.00716.82
8.0.200.0060.00016.97
8.0.190.0050.00216.94
8.0.180.0030.00816.95
8.0.170.0000.00816.82
8.0.160.0000.00716.95
8.0.150.0050.00516.74
8.0.140.0000.00816.77
8.0.130.0000.00613.37
8.0.120.0050.00316.86
8.0.110.0000.00816.80
8.0.100.0040.00416.89
8.0.90.0090.00016.80
8.0.80.0090.01316.84
8.0.70.0000.00816.68
8.0.60.0000.00916.80
8.0.50.0030.00516.89
8.0.30.0160.00317.12
8.0.20.0150.01017.40
8.0.10.0000.00717.06
8.0.00.0070.01016.61
7.4.330.0050.00015.00
7.4.320.0040.00416.58
7.4.300.0030.00316.49
7.4.290.0040.00416.53
7.4.280.0000.00716.51
7.4.270.0000.00716.56
7.4.260.0000.00513.29
7.4.250.0040.00416.48
7.4.240.0040.00416.51
7.4.230.0030.00516.61
7.4.220.0160.01316.43
7.4.210.0080.00616.57
7.4.200.0030.00416.65
7.4.190.0000.00716.63
7.4.160.0060.02716.57
7.4.150.0170.00317.40
7.4.140.0130.01217.86
7.4.130.0170.00316.44
7.4.120.0090.00916.50
7.4.110.0030.01416.57
7.4.100.0110.00816.55
7.4.90.0070.01416.66
7.4.80.0040.01319.39
7.4.70.0030.01616.62
7.4.60.0090.00916.45
7.4.50.0000.00816.23
7.4.40.0070.01022.77
7.4.30.0070.01716.60
7.4.00.0090.00715.00
7.3.330.0050.00013.44
7.3.320.0030.00313.30
7.3.310.0050.00316.27
7.3.300.0040.00416.38
7.3.290.0040.01516.36
7.3.280.0080.00816.36
7.3.270.0090.01117.40
7.3.260.0110.00716.55
7.3.250.0100.01016.59
7.3.240.0120.00616.60
7.3.230.0080.00816.46
7.3.210.0060.01216.68
7.3.200.0090.01419.39
7.3.190.0170.00616.46
7.3.180.0090.00916.49
7.3.170.0000.01616.46
7.3.160.0130.00316.51
7.3.120.0060.01014.77
7.3.110.0100.00314.98
7.3.100.0130.00315.09
7.3.90.0000.01514.76
7.3.80.0030.01714.97
7.3.70.0100.00315.02
7.3.60.0030.00714.86
7.3.50.0090.00614.79
7.3.40.0000.01814.86
7.3.30.0070.00714.99
7.3.20.0100.00616.41
7.3.10.0040.01416.54
7.3.00.0030.00916.71
7.2.330.0050.01416.36
7.2.320.0090.00916.56
7.2.310.0040.01316.81
7.2.300.0140.00316.74
7.2.290.0060.01916.46
7.2.250.0030.01715.10
7.2.240.0120.00614.70
7.2.230.0070.01014.87
7.2.220.0040.00815.21
7.2.210.0140.00714.95
7.2.200.0070.00715.20
7.2.190.0100.00615.18
7.2.180.0120.00315.15
7.2.170.0040.01415.19
7.2.60.0000.01117.06
7.1.330.0000.01415.84
7.1.320.0050.00515.94
7.1.310.0030.01615.92
7.1.300.0040.01115.74
7.1.290.0040.01515.80
7.1.280.0030.00616.01
7.1.270.0100.00715.62
7.1.260.0000.00915.86
7.1.200.0080.00515.42
7.1.70.0000.00817.25
7.1.60.0100.01619.32
7.1.50.0060.01316.64
7.1.00.0070.04722.54
7.0.200.0000.01016.94
7.0.140.0000.07722.07
7.0.100.0130.07719.93
7.0.90.0230.07319.85
7.0.80.0030.04019.98
7.0.70.0000.04319.93
7.0.60.0000.04319.82
7.0.50.0330.07320.29
7.0.40.0070.06719.91
7.0.30.0030.08020.03
7.0.20.0130.05020.08
7.0.10.0100.07020.02
7.0.00.0070.03720.07
5.6.280.0030.07320.84
5.6.250.0130.06020.70
5.6.240.0070.04720.70
5.6.230.0070.06320.48
5.6.220.0070.04020.63
5.6.210.0030.04020.73
5.6.200.0030.05021.01
5.6.190.0100.03320.89
5.6.180.0130.05320.92
5.6.170.0000.06720.98
5.6.160.0000.04721.11
5.6.150.0030.04320.99
5.6.140.0030.04021.03
5.6.130.0170.07320.91
5.6.120.0100.03721.04
5.6.110.0030.04321.13
5.6.100.0030.04020.97
5.6.90.0100.03720.98
5.6.80.0030.04020.45
5.6.70.0030.04320.29
5.6.60.0070.03720.42
5.6.50.0100.03020.37
5.6.40.0000.04320.29
5.6.30.0130.06720.36
5.6.20.0070.04720.27
5.6.10.0030.05720.50
5.6.00.0130.07020.39
5.5.380.0070.05020.38
5.5.370.0070.04020.47
5.5.360.0000.04320.50
5.5.350.0030.04020.36
5.5.340.0030.04020.82
5.5.330.0100.08020.80
5.5.320.0000.09020.85
5.5.310.0030.04020.84
5.5.300.0030.06720.77
5.5.290.0070.03720.89
5.5.280.0000.04320.75
5.5.270.0030.04020.74
5.5.260.0070.03720.84
5.5.250.0030.03720.54
5.5.240.0070.03720.18
5.5.230.0130.03320.25
5.5.220.0070.03720.27
5.5.210.0070.03720.16
5.5.200.0030.04020.21
5.5.190.0070.06320.22
5.5.180.0070.03320.20
5.5.160.0030.04020.10
5.5.150.0030.07720.18
5.5.140.0130.04720.22
5.5.130.0200.06020.22
5.5.120.0130.07020.08
5.5.110.0000.06020.20
5.5.100.0030.08320.02
5.5.90.0100.07319.98
5.5.80.0070.08320.08
5.5.70.0070.07320.11
5.5.60.0170.07020.07
5.5.50.0100.07320.03
5.5.40.0070.07720.13
5.5.30.0070.04020.06
5.5.20.0070.07320.13
5.5.10.0170.07019.95
5.5.00.0100.07319.96
5.4.450.0030.04019.47
5.4.440.0000.04319.45
5.4.430.0070.03719.48
5.4.420.0030.04019.48
5.4.410.0000.03719.15
5.4.400.0030.05018.97
5.4.390.0070.04019.04
5.4.380.0030.03719.09
5.4.370.0000.04018.88
5.4.360.0000.04019.03
5.4.350.0070.03319.21
5.4.340.0070.03319.09
5.4.320.0100.06719.14
5.4.310.0070.03719.21
5.4.300.0030.07719.25
5.4.290.0070.07718.85
5.4.280.0070.07319.14
5.4.270.0070.07319.20
5.4.260.0070.08319.09
5.4.250.0100.07719.05
5.4.240.0100.07019.03
5.4.230.0070.07318.95
5.4.220.0130.07319.21
5.4.210.0100.05719.18
5.4.200.0070.05318.85
5.4.190.0070.07019.03
5.4.180.0130.05318.91
5.4.170.0100.07319.02
5.4.160.0070.07319.15
5.4.150.0070.08019.01
5.4.140.0070.07716.41
5.4.130.0070.06716.29
5.4.120.0030.05316.38
5.4.110.0000.05016.52
5.4.100.0100.04316.37
5.4.90.0070.06716.43
5.4.80.0100.06316.49
5.4.70.0170.06316.48
5.4.60.0070.05316.47
5.4.50.0030.07016.46
5.4.40.0070.07716.46
5.4.30.0000.07016.33
5.4.20.0000.08016.50
5.4.10.0070.07716.48
5.4.00.0070.06315.81
5.3.290.0070.07714.66
5.3.280.0100.07314.64
5.3.270.0100.07714.69
5.3.260.0030.07314.64
5.3.250.0200.06314.73
5.3.240.0070.07714.63
5.3.230.0200.04014.59
5.3.220.0070.04714.54
5.3.210.0000.08314.65
5.3.200.0100.07014.68
5.3.190.0100.06714.68
5.3.180.0030.08014.65
5.3.170.0100.07314.55
5.3.160.0030.07714.68
5.3.150.0070.05714.57
5.3.140.0070.08314.70
5.3.130.0130.06714.57
5.3.120.0000.08714.63
5.3.110.0030.07714.56
5.3.100.0070.07314.19
5.3.90.0000.07714.09
5.3.80.0070.07014.13
5.3.70.0130.06714.17
5.3.60.0130.06314.03
5.3.50.0030.07713.98
5.3.40.0100.07014.03
5.3.30.0070.07714.04
5.3.20.0130.06313.77
5.3.10.0100.06713.69
5.3.00.0100.06313.72
5.2.170.0030.06011.05
5.2.160.0030.06711.18
5.2.150.0070.03011.08
5.2.140.0100.05311.30
5.2.130.0070.05011.13
5.2.120.0070.06011.03
5.2.110.0030.05711.18
5.2.100.0070.06011.05
5.2.90.0100.04011.13
5.2.80.0070.06011.02
5.2.70.0100.04711.00
5.2.60.0000.06711.21
5.2.50.0100.05311.13
5.2.40.0000.04010.93
5.2.30.0100.05710.98
5.2.20.0100.03711.10
5.2.10.0130.05310.93
5.2.00.0070.05710.75
5.1.60.0000.0539.86
5.1.50.0000.05310.05
5.1.40.0030.05310.09
5.1.30.0030.05310.42
5.1.20.0070.05710.30
5.1.10.0000.03010.16
5.1.00.0070.05010.15
5.0.50.0070.0438.42
5.0.40.0030.0438.45
5.0.30.0070.0608.33
5.0.20.0100.0338.34
5.0.10.0070.0338.33
5.0.00.0030.0638.25
4.4.90.0000.0408.14
4.4.80.0030.0338.14
4.4.70.0000.0308.18
4.4.60.0000.0378.25
4.4.50.0070.0308.25
4.4.40.0030.0508.25
4.4.30.0000.0378.25
4.4.20.0030.0308.25
4.4.10.0070.0308.25
4.4.00.0000.0438.25
4.3.110.0030.0378.25
4.3.100.0030.0208.25
4.3.90.0000.0408.25
4.3.80.0030.0478.25
4.3.70.0000.0378.25
4.3.60.0070.0308.25
4.3.50.0030.0378.25
4.3.40.0000.0578.25
4.3.30.0030.0338.25
4.3.20.0000.0378.25
4.3.10.0000.0408.25
4.3.00.0000.0378.25

preferences:
51.7 ms | 400 KiB | 5 Q