3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( "100" => array( array( "country" => 'France', "city" => 'Paris', "population" => '1800000', ), array( "country" => 'France', "city" => 'Paris', "population" => '2000000', ), array( "country" => 'France', "city" => 'Toulouse', "population" => '500000', ), ), "101" => array( array( "country" => 'Russia', "city" => 'Moscow', "population" => '144000000', ) ) ); foreach($arr as $k => &$ar) { $mins = array_reduce($ar, function ($carry, $item) { $key = $item["country"] . "###" . $item["city"]; $carry[$key] = (isset($carry[$key]) && $item["population"] > $carry[$key]) ? $carry[$key] : $item["population"]; return $carry; }, []); $ar = array_filter($ar, function ($item) use ($mins) { $key = $item["country"] . "###" . $item["city"]; return $mins[$key] == $item["population"]; }); } print_r($arr);

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.0120.00516.70
8.5.00.0110.01020.05
8.4.150.0010.00114.05
8.4.140.0110.00917.50
8.4.130.0100.01017.66
8.4.120.0080.00320.56
8.4.110.0130.00522.57
8.4.100.0160.00617.85
8.4.90.0130.00818.83
8.4.80.0140.00818.11
8.4.70.0120.00917.81
8.4.60.0160.00419.14
8.4.50.0120.00817.98
8.4.40.0190.00019.27
8.4.30.0190.00024.23
8.4.20.0040.01218.84
8.4.10.0090.00017.94
8.3.280.0100.01020.29
8.3.270.0170.00316.64
8.3.260.0090.01017.04
8.3.250.0110.00719.04
8.3.240.0090.01016.71
8.3.230.0130.00616.35
8.3.220.0020.00717.41
8.3.210.0100.00916.66
8.3.200.0060.00316.65
8.3.190.0040.00417.30
8.3.180.0150.00516.55
8.3.170.0120.00620.66
8.3.160.0120.00618.29
8.3.150.0130.00720.59
8.3.140.0080.00020.56
8.3.130.0080.00018.42
8.3.120.0060.00318.95
8.3.110.0030.00620.94
8.3.100.0060.00324.06
8.3.90.0100.00026.77
8.3.80.0100.00018.55
8.3.70.0090.00616.63
8.3.60.0060.01218.32
8.3.50.0090.00818.22
8.3.40.0210.00019.02
8.3.30.0070.01118.68
8.3.20.0040.01120.60
8.3.10.0040.00423.71
8.3.00.0040.00420.63
8.2.290.0090.00920.38
8.2.280.0030.00520.22
8.2.270.0090.00918.99
8.2.260.0090.00616.71
8.2.250.0040.00716.45
8.2.240.0130.00617.41
8.2.230.0050.00322.58
8.2.220.0100.00037.54
8.2.210.0110.00426.77
8.2.200.0090.00316.63
8.2.190.0100.01016.58
8.2.180.0120.00916.88
8.2.170.0090.00622.96
8.2.160.0110.00420.43
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0100.00018.03
8.2.120.0090.00526.35
8.2.110.0090.00019.26
8.2.100.0080.00418.03
8.2.90.0040.00417.75
8.2.80.0000.00818.09
8.2.70.0080.00018.04
8.2.60.0030.00518.34
8.2.50.0000.00918.10
8.2.40.0040.00419.42
8.2.30.0080.00020.56
8.2.20.0000.00818.09
8.2.10.0000.00720.96
8.2.00.0040.00418.20
8.1.330.0110.00821.75
8.1.320.0130.00716.54
8.1.310.0030.00516.82
8.1.300.0000.01918.15
8.1.290.0090.00030.84
8.1.280.0100.00625.92
8.1.270.0000.00822.21
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0030.00621.01
8.1.230.0030.00719.01
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0060.00318.85
8.1.150.0000.00718.77
8.1.140.0050.00318.96
8.1.130.0030.00320.31
8.1.120.0030.00317.40
8.1.110.0050.00317.40
8.1.100.0050.00317.29
8.1.90.0050.00317.46
8.1.80.0030.00617.38
8.1.70.0030.00617.37
8.1.60.0040.00417.54
8.1.50.0060.00317.52
8.1.40.0000.00817.45
8.1.30.0000.00817.52
8.1.20.0040.00417.64
8.1.10.0050.00317.52
8.1.00.0040.00417.56
8.0.300.0020.00519.60
8.0.290.0050.00316.63
8.0.280.0050.00218.43
8.0.270.0070.00016.69
8.0.260.0000.00618.49
8.0.250.0040.00416.86
8.0.240.0070.00016.93
8.0.230.0030.00316.89
8.0.220.0000.00716.93
8.0.210.0040.00416.93
8.0.200.0030.00316.89
8.0.190.0030.00517.00
8.0.180.0040.00416.90
8.0.170.0060.00316.93
8.0.160.0040.00316.83
8.0.150.0000.00816.87
8.0.140.0000.00716.78
8.0.130.0000.00613.38
8.0.120.0000.00716.94
8.0.110.0040.00416.86
8.0.100.0000.00716.83
8.0.90.0040.00416.78
8.0.80.0080.00816.91
8.0.70.0040.00416.72
8.0.60.0000.00816.67
8.0.50.0030.00516.75
8.0.30.0080.01017.10
8.0.20.0130.01316.91
8.0.10.0040.00416.81
8.0.00.0120.00716.79
7.4.330.0020.00216.79
7.4.320.0030.00316.59
7.4.300.0030.00316.49
7.4.290.0030.00316.40
7.4.280.0080.00016.60
7.4.270.0000.00716.38
7.4.260.0040.00416.59
7.4.250.0030.00616.59
7.4.240.0030.00316.47
7.4.230.0050.00316.62
7.4.220.0000.00816.56
7.4.210.0070.00816.58
7.4.200.0070.00016.39
7.4.160.0110.00616.42
7.4.130.0090.00916.45
7.4.120.0030.02016.52
7.4.110.0120.01216.70
7.4.100.0060.01216.49
7.4.90.0060.01016.40
7.4.80.0170.00919.39
7.4.70.0120.00616.64
7.4.60.0060.00916.48
7.4.50.0000.01416.43
7.4.40.0140.00316.70
7.4.00.0060.00615.02
7.3.330.0030.00313.19
7.3.320.0000.00613.29
7.3.310.0050.00216.40
7.3.300.0000.00816.38
7.3.290.0030.00316.47
7.3.280.0080.00916.33
7.3.260.0100.00716.47
7.3.240.0130.00616.48
7.3.230.0060.01316.40
7.3.210.0070.01116.57
7.3.200.0080.00816.52
7.3.190.0060.01516.37
7.3.180.0090.00916.38
7.3.170.0150.00316.36
7.3.160.0100.00616.45
7.3.40.0000.01314.65
7.3.30.0110.01114.54
7.3.20.0120.00616.45
7.3.10.0120.00616.56
7.3.00.0090.01516.67
7.2.330.0100.01016.85
7.2.320.0130.00316.50
7.2.310.0070.01416.77
7.2.300.0130.01016.48
7.2.290.0150.00616.84
7.2.170.0110.01015.04
7.2.160.0040.00814.95
7.2.150.0080.00416.73
7.2.140.0000.01116.73
7.2.130.0070.01116.86
7.2.120.0120.00416.93
7.2.110.0100.00316.46
7.2.100.0040.00716.76
7.2.90.0080.01116.85
7.2.80.0060.01316.85
7.2.70.0000.01416.64
7.2.60.0000.01116.79
7.2.50.0070.00316.97
7.2.40.0080.00616.77
7.2.30.0140.00716.87
7.2.20.0090.01216.98
7.2.10.0120.01216.82
7.2.00.0110.00716.86
7.1.280.0200.00015.43
7.1.270.0040.00815.62
7.1.260.0130.00615.72
7.1.250.0090.01215.69

preferences:
38.51 ms | 403 KiB | 5 Q