3v4l.org

run code in 300+ PHP versions simultaneously
<?php $resultset = [ ['id' => 1, 'type' => 'F-A', 'name' => 'jon', 'age' => 24], ['id' => 2, 'type' => 'F-A', 'name' => 'roy', 'age' => 25], ['id' => 3, 'type' => 'F-E', 'name' => 'robert', 'age' => 26], ['id' => 4, 'type' => 'F-E', 'name' => 'sina', 'age' => 25] ]; foreach ($resultset as $row) { $output['type'][$row['type']][] = ['name' => $row['name'], 'age' => $row['age'], 'id' => $row['id']]; } echo json_encode($output, JSON_PRETTY_PRINT);

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.80.0090.00017.97
8.3.70.0120.00318.48
8.3.60.0100.00717.99
8.3.50.0160.00518.01
8.3.40.0120.00318.84
8.3.30.0070.01018.85
8.3.20.0030.00519.15
8.3.10.0160.00423.66
8.3.00.0000.00822.30
8.2.200.0050.00518.13
8.2.190.0080.00816.58
8.2.180.0070.00718.54
8.2.170.0120.00322.96
8.2.160.0120.00321.08
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0000.00820.01
8.2.110.0090.00022.19
8.2.100.0000.01117.90
8.2.90.0080.00519.07
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0060.00318.03
8.2.50.0030.00518.07
8.2.40.0090.00018.22
8.2.30.0000.00718.25
8.2.20.0060.00318.19
8.2.10.0040.00417.93
8.2.00.0020.00519.45
8.1.290.0080.00318.88
8.1.280.0070.01425.92
8.1.270.0020.00523.84
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0090.00020.68
8.1.230.0100.00317.89
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0070.00317.25
8.1.190.0040.00417.22
8.1.180.0030.00518.10
8.1.170.0060.00318.57
8.1.160.0030.00618.89
8.1.150.0050.00218.87
8.1.140.0030.00318.92
8.1.130.0000.00719.07
8.1.120.0000.00717.48
8.1.110.0040.00317.40
8.1.100.0040.00417.34
8.1.90.0050.00217.47
8.1.80.0000.00817.35
8.1.70.0000.00817.33
8.1.60.0040.00417.57
8.1.50.0040.00417.50
8.1.40.0040.00417.41
8.1.30.0000.00917.61
8.1.20.0000.00717.54
8.1.10.0000.00817.47
8.1.00.0000.00717.54
8.0.300.0040.00418.77
8.0.290.0050.00516.62
8.0.280.0000.00718.35
8.0.270.0030.00317.22
8.0.260.0060.00017.16
8.0.250.0000.00716.85
8.0.240.0070.00016.95
8.0.230.0030.00316.92
8.0.220.0070.00016.76
8.0.210.0000.00716.85
8.0.200.0060.00017.02
8.0.190.0040.00416.91
8.0.180.0080.00016.84
8.0.170.0030.00616.85
8.0.160.0040.00416.91
8.0.150.0050.00516.79
8.0.140.0070.00016.76
8.0.130.0060.00013.27
8.0.120.0000.00716.91
8.0.110.0070.00016.95
8.0.100.0030.00516.87
8.0.90.0000.00716.94
8.0.80.0060.01216.94
8.0.70.0050.00316.84
8.0.60.0050.00216.76
8.0.50.0040.00416.75
8.0.30.0080.01117.14
8.0.20.0090.00917.40
8.0.10.0030.00517.00
8.0.00.0080.01116.98
7.4.330.0000.00415.55
7.4.320.0000.00616.52
7.4.300.0070.00016.51
7.4.290.0070.00016.40
7.4.280.0040.00416.53
7.4.270.0040.00416.59
7.4.260.0040.00416.60
7.4.250.0000.00716.48
7.4.240.0030.00316.61
7.4.230.0000.00716.34
7.4.220.0080.00016.53
7.4.210.0040.01116.59
7.4.200.0000.00716.58
7.4.160.0060.01216.58
7.4.140.0080.01117.86
7.4.130.0060.01216.41
7.4.120.0110.00916.53
7.4.110.0160.00616.44
7.4.100.0030.01416.47
7.4.90.0070.01116.52
7.4.80.0070.01319.39
7.4.70.0110.00716.50
7.4.60.0000.01516.41
7.4.50.0160.00016.47
7.4.40.0160.00716.54
7.4.00.0060.01014.78
7.3.330.0050.00013.18
7.3.320.0000.00613.08
7.3.310.0030.00316.27
7.3.300.0050.00516.28
7.3.290.0000.00616.36
7.3.280.0080.00716.30
7.3.260.0100.00816.45
7.3.240.0140.00616.38
7.3.230.0100.01016.43
7.3.210.0060.01016.23
7.3.200.0130.00316.53
7.3.190.0130.00316.32
7.3.180.0040.01216.31
7.3.170.0070.01016.26
7.3.160.0130.01016.38
7.3.120.0090.01215.05
7.3.110.0070.01014.57
7.3.100.0120.00614.77
7.3.90.0030.01314.92
7.3.80.0070.01014.77
7.3.70.0070.00714.87
7.3.60.0100.00714.80
7.3.50.0000.01214.85
7.3.40.0070.01014.60
7.3.30.0080.00414.99
7.3.20.0110.00316.73
7.3.10.0080.00816.69
7.3.00.0030.00716.57
7.2.330.0100.00716.54
7.2.320.0040.01416.84
7.2.310.0100.00616.65
7.2.300.0130.00316.43
7.2.290.0060.00916.79
7.2.250.0070.01114.81
7.2.240.0030.01315.19
7.2.230.0060.00914.87
7.2.220.0000.00914.98
7.2.210.0030.00614.95
7.2.200.0040.01114.91
7.2.190.0090.00315.00
7.2.180.0070.01014.77
7.2.170.0030.01414.69
7.2.130.0040.00816.91
7.2.120.0030.00716.79
7.2.110.0030.01016.83
7.2.100.0060.00616.89
7.2.90.0070.00716.85
7.2.80.1040.00715.95
7.2.70.1040.00316.05
7.2.60.0880.01015.88
7.2.50.1140.00316.06
7.2.40.0790.00715.97
7.2.30.0700.00215.92
7.2.20.1620.00515.99
7.2.10.0810.01315.97
7.2.00.0970.00615.91
7.1.330.0110.00415.73
7.1.320.0000.00915.77
7.1.310.0130.00015.53
7.1.300.0070.00715.67
7.1.290.0080.00815.97
7.1.280.0030.01415.54
7.1.270.0000.01715.66
7.1.260.0030.01315.47
7.1.250.0030.01115.68
7.1.200.1440.00613.65
7.1.190.1600.00613.80
7.1.180.2410.01013.86
7.1.170.2720.00313.82
7.1.160.1240.00913.75
7.1.150.2150.00613.65
7.1.140.2950.00314.00
7.1.130.1470.01813.71
7.1.120.1700.00013.92
7.1.110.1020.01313.99
7.1.100.1490.00314.01
7.1.90.3440.01013.68
7.1.80.3080.01013.87
7.1.70.2250.00713.74
7.1.60.3590.01031.93
7.1.50.3210.01031.71
7.1.40.2040.01331.89
7.1.30.2620.01331.86
7.1.20.2470.01031.80
7.1.10.2660.00013.88
7.1.00.1640.00713.82

preferences:
60.87 ms | 402 KiB | 5 Q