3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( "FL_1" => array( "MIC_1" => array( "SP_4" => 7 ), "MIC_13" => array( "SP_16" => 4 ), "MIC_6" => array( "SP_74" => 4 ) ), "FL_2" => array( "MIC_1" => array( "SP_5" => 4 ), "MIC_13" => array( "SP_17" => 4 ), "MIC_6" => array( "SP_75" => 4 ) ), "FL_3" => array( "MIC_1" => array( "SP_5" => 89 ), "MIC_13" => array( "SP_18" => 1 ), "MIC_6" => array( "SP_78" => 21 ) ) ); // find the minimum SP_X value and its key $min_sp = PHP_INT_MAX; $min_key = ''; array_walk_recursive($array, function ($v, $k) use (&$min_sp, &$min_key) { if ($v < $min_sp) { $min_sp = $v; $min_key = $k; } }); echo "$min_key => $min_sp\n"; // find the MIC_X key corresponding to the min SP_X value $mic_key = ''; foreach ($array as $fl) { foreach ($fl as $mic => $sp) { if (isset($sp[$min_key]) && $sp[$min_key] == $min_sp) { $mic_key = $mic; break 2; } } } echo "$mic_key\n"; // filter the array to get all the MIC_X values $out = array_map(function ($fl) use ($mic_key) { return array_filter($fl, function ($mic) use ($mic_key) { return $mic == $mic_key; }, ARRAY_FILTER_USE_KEY); }, $array); print_r($out);

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.10.0090.00920.77
8.3.140.0050.00318.38
8.3.130.0100.00018.36
8.3.120.0110.00818.82
8.3.110.0050.00316.91
8.3.100.0110.00416.48
8.3.90.0030.00526.77
8.3.80.0050.00516.88
8.3.70.0090.00916.88
8.3.60.0060.01218.31
8.3.50.0170.00724.48
8.3.40.0140.00718.71
8.3.30.0040.01118.67
8.3.20.0070.00021.85
8.3.10.0040.00420.02
8.3.00.0040.00423.53
8.2.260.0090.00616.54
8.2.250.0050.00318.41
8.2.240.0040.00418.98
8.2.230.0060.00320.94
8.2.220.0000.01424.06
8.2.210.0040.00426.77
8.2.200.0050.00516.63
8.2.190.0120.00916.75
8.2.180.0080.00816.75
8.2.170.0070.00722.96
8.2.160.0030.01020.46
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0030.01026.16
8.2.110.0100.00021.03
8.2.100.0040.00817.84
8.2.90.0040.00418.03
8.2.80.0090.00017.97
8.2.70.0000.00817.63
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0090.00018.22
8.2.30.0000.00818.16
8.2.20.0080.00018.04
8.2.10.0000.00719.26
8.2.00.0000.00819.41
8.1.310.0030.00617.84
8.1.300.0130.00620.16
8.1.290.0060.00330.84
8.1.280.0070.01425.92
8.1.270.0000.00823.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0050.00522.48
8.1.230.0080.00421.03
8.1.220.0040.00417.78
8.1.210.0000.00818.86
8.1.200.0030.00617.35
8.1.190.0060.00317.23
8.1.180.0000.00718.10
8.1.170.0070.00318.50
8.1.160.0080.00018.91
8.1.150.0040.00418.84
8.1.140.0080.00018.90
8.1.130.0000.00717.54
8.1.120.0050.00217.39
8.1.110.0040.00417.48
8.1.100.0030.00517.47
8.1.90.0000.00717.55
8.1.80.0000.00817.52
8.1.70.0040.00417.36
8.1.60.0030.00617.61
8.1.50.0040.00417.46
8.1.40.0040.00417.57
8.1.30.0000.00917.59
8.1.20.0060.00317.72
8.1.10.0020.00517.55
8.1.00.0030.00617.41
8.0.300.0040.00420.03
8.0.290.0000.00716.75
8.0.280.0040.00418.48
8.0.270.0030.00318.07
8.0.260.0030.00316.89
8.0.250.0030.00316.86
8.0.240.0040.00417.06
8.0.230.0000.00716.90
8.0.220.0030.00316.91
8.0.210.0070.00016.90
8.0.200.0000.00716.97
8.0.190.0080.00017.02
8.0.180.0000.00816.86
8.0.170.0060.00316.96
8.0.160.0000.00816.91
8.0.150.0060.00316.89
8.0.140.0100.00016.90
8.0.130.0000.00513.37
8.0.120.0050.00316.92
8.0.110.0040.00416.96
8.0.100.0000.00816.80
8.0.90.0090.00016.96
8.0.80.0070.01016.93
8.0.70.0000.00816.97
8.0.60.0000.00716.95
8.0.50.0070.00016.79
8.0.30.0070.01117.16
8.0.20.0160.00316.98
8.0.10.0080.00016.85
8.0.00.0110.00716.98
7.4.330.0050.00015.55
7.4.320.0030.00316.59
7.4.300.0030.00316.67
7.4.290.0050.00316.67
7.4.280.0030.00716.55
7.4.270.0070.00016.66
7.4.260.0000.00513.36
7.4.250.0030.00316.49
7.4.240.0050.00216.53
7.4.230.0000.00716.54
7.4.220.0040.00316.39
7.4.210.0070.00916.63
7.4.200.0000.00716.52
7.4.130.0080.01016.58
7.4.120.0100.00616.63
7.4.110.0110.00716.52
7.4.100.0160.00016.59
7.4.90.0080.00916.70
7.4.80.0140.00919.39
7.4.70.0160.01016.46
7.4.60.0110.00616.58
7.4.50.0090.00616.53
7.4.40.0060.01016.58
7.4.30.0060.01116.58
7.4.20.0090.00616.41
7.4.10.0080.00816.52
7.4.00.0030.01316.50
7.3.330.0070.00016.50
7.3.320.0000.00613.41
7.3.310.0040.00416.30
7.3.300.0000.00716.47
7.3.290.0070.00816.44
7.3.260.0130.00716.58
7.3.240.0060.01116.48
7.3.230.0110.00716.39
7.3.210.0070.01016.68
7.3.200.0070.01316.41
7.3.190.0030.01316.40
7.3.180.0100.00716.28
7.3.170.0150.00016.49
7.3.160.0130.00916.63
7.3.150.0160.00016.48
7.3.140.0120.00316.41
7.3.130.0160.00016.56
7.3.120.0110.00716.44
7.3.110.0030.01416.36
7.3.100.0110.00616.57
7.3.90.0070.01016.39
7.3.80.0140.00416.29
7.3.70.0060.00916.46
7.3.60.0050.01116.50
7.3.50.0090.00916.36
7.3.40.0130.00716.46
7.3.30.0060.01116.44
7.3.20.0140.00316.45
7.3.10.0160.00616.29
7.3.00.0100.00716.56
7.2.330.0110.00816.74
7.2.320.0070.01016.78
7.2.310.0100.01016.86
7.2.300.0090.01416.76
7.2.290.0140.01116.61
7.2.280.0070.01016.44
7.2.270.0030.01216.71
7.2.260.0080.00816.54
7.2.250.0000.01716.50
7.2.240.0080.01216.53
7.2.230.0030.01316.57
7.2.220.0070.01116.65
7.2.210.0100.00616.73
7.2.200.0060.01016.52
7.2.190.0030.01316.53
7.2.180.0180.00316.41
7.2.170.0100.00816.80
7.2.160.0110.01416.38
7.2.150.0160.00816.71
7.2.140.0110.00616.80
7.2.130.0040.01316.48
7.2.120.0100.00716.52
7.2.110.0130.00316.75
7.2.100.0060.01216.64
7.2.90.0100.00716.56
7.2.80.0100.00716.59
7.2.70.0070.01016.57
7.2.60.0140.00316.50
7.2.50.0190.00716.58
7.2.40.0130.00716.70
7.2.30.0060.01016.53
7.2.20.0120.00616.71
7.2.10.0090.00916.65
7.2.00.0090.01316.80

preferences:
28.73 ms | 403 KiB | 5 Q