3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 98 => array( 'City' => 'Caracas', 'Country' => 'Venezuela', 'Continent' => 'Latin America', ), 99 => array( 'City' => 'Cairo', 'Country' => 'Egypt', 'Continent' => 'Middle East', ), 105 => array( 'City' => 'Abu Dhabi', 'Country' => 'United Arab Emirates', 'Continent' => 'Middle East', ), 106 => array( 'City' => 'Dubai', 'Country' => 'United Arab Emirates', 'Continent' => 'Middle East', ), 107 => array( 'City' => 'Montreal', 'Country' => 'Canada', 'Continent' => 'North America', ) ); $result = []; foreach ( $array as [ 'Continent' => $a, 'Country' => $b, 'City' => $result[$a][$b][] ] ); var_export( array_reduce( $array, function($result, $row) { $result[$row['Continent']][$row['Country']][] = $row['City']; return $result; } ) );

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.140.0120.00817.55
8.4.130.0090.00817.77
8.4.120.0110.00818.61
8.4.110.0130.00818.98
8.4.100.0120.00717.84
8.4.90.0120.00820.88
8.4.80.0100.00720.59
8.4.70.0070.01018.87
8.4.60.0040.00419.16
8.4.50.0110.00920.38
8.4.40.0100.01019.20
8.4.30.0070.00418.74
8.4.20.0200.00025.86
8.4.10.0120.00323.91
8.3.270.0080.01016.84
8.3.260.0130.00716.80
8.3.250.0080.01018.90
8.3.240.0060.00816.63
8.3.230.0130.00517.16
8.3.220.0090.00919.16
8.3.210.0080.01116.84
8.3.200.0040.00416.54
8.3.190.0070.00217.06
8.3.180.0100.00919.07
8.3.170.0140.00418.95
8.3.160.0040.01116.80
8.3.150.0170.00318.89
8.3.140.0080.00016.56
8.3.130.0100.01018.35
8.3.120.0040.00418.86
8.3.110.0060.00316.61
8.3.100.0060.00316.79
8.3.90.0040.00426.77
8.3.80.0030.00618.40
8.3.70.0100.00716.63
8.3.60.0130.00318.31
8.3.50.0140.00316.76
8.3.40.0100.00320.52
8.3.30.0130.00318.41
8.3.20.0060.00324.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.290.0120.00717.26
8.2.280.0100.00718.65
8.2.270.0110.00717.29
8.2.260.0090.00918.89
8.2.250.0070.01116.79
8.2.240.0050.00519.17
8.2.230.0000.00820.94
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0120.00016.63
8.2.190.0110.00716.63
8.2.180.0120.00616.63
8.2.170.0120.00318.91
8.2.160.0130.00322.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00721.13
8.2.110.0070.01620.47
8.2.100.0130.00017.72
8.2.90.0050.00317.91
8.2.80.0040.00419.35
8.2.70.0050.00317.36
8.2.60.0040.00717.68
8.2.50.0040.00418.07
8.2.40.0050.00519.88
8.2.30.0040.00418.17
8.2.20.0040.00419.33
8.2.10.0150.00017.79
8.2.00.0100.00717.74
8.1.330.0110.00716.07
8.1.320.0120.00716.19
8.1.310.0000.00816.98
8.1.300.0090.00616.25
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0080.00322.59
8.1.230.0090.00320.89
8.1.220.0040.00417.74
8.1.210.0000.00818.98
8.1.200.0030.00617.35
8.1.190.0000.00817.11
8.1.180.0060.00318.10
8.1.170.0040.00419.10
8.1.160.0000.00818.81
8.1.150.0040.00418.66
8.1.140.0100.00717.44
8.1.130.0120.00417.43
8.1.120.0100.00717.51
8.1.110.0090.00617.45
8.1.100.0130.00717.40
8.1.90.0070.00717.42
8.1.80.0140.00517.51
8.1.70.0100.00617.52
8.1.60.0190.00017.64
8.1.50.0180.00017.56
8.1.40.0120.00617.57
8.1.30.0130.00517.60
8.1.20.0170.00317.65
8.1.10.0160.00517.60
8.1.00.0130.00717.55
8.0.300.0040.00419.95
8.0.290.0000.00716.75
8.0.280.0000.00718.36
8.0.270.0100.00516.82
8.0.260.0130.00016.81
8.0.250.0050.00616.88
8.0.240.0080.00016.87
8.0.230.0070.00416.88
8.0.220.0060.00916.82
8.0.210.0110.00816.73
8.0.200.0100.00516.84
8.0.190.0000.00916.70
8.0.180.0060.00616.77
8.0.170.0140.00016.87
8.0.160.0040.01216.80
8.0.150.0080.00816.80
8.0.140.0120.00416.80
8.0.130.0040.01316.80
8.0.120.0120.00516.73
8.0.110.0100.00716.82
8.0.100.0130.00416.87
8.0.90.0120.00316.81
8.0.80.0140.00216.69
8.0.70.0100.00616.80
8.0.60.0080.00816.80
8.0.50.0180.00016.70
8.0.30.0090.00616.81
8.0.20.0120.00316.84
8.0.10.0050.01116.94
7.4.330.0080.00116.58

preferences:
30.74 ms | 403 KiB | 5 Q