3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ 'a1' => ['a_name' => 'aaaaa', 'a_value' => 'aaa'], 'b1' => ['b_name' => 'bbbbb', 'b_value' => 'bbb'], 'c1' => ['c_name' => 'ccccc', 'c_value' => 'ccc'], ]; $array2 = ['b1' => ['b_name' => 'bbbbb'], 'c1' => ['a_value' => 'aaa']]; $result = array_intersect_key($array1, $array2); foreach ($result as $key => &$value) { $value = array_intersect_key($value, $array2[$key]); if (!$value) { unset($result[$key]); } } var_export($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.0040.00417.77
8.4.130.0090.00819.05
8.4.120.0130.00724.05
8.4.110.0040.00419.01
8.4.100.0060.00317.66
8.4.90.0050.00317.73
8.4.80.0070.00719.71
8.4.70.0090.00617.70
8.4.60.0160.00518.63
8.4.50.0110.00918.02
8.4.40.0080.01120.21
8.4.30.0080.00020.30
8.4.20.0060.01317.78
8.4.10.0040.00422.14
8.3.270.0120.00716.59
8.3.260.0100.01016.48
8.3.250.0130.00819.09
8.3.240.0110.00717.12
8.3.230.0090.00216.86
8.3.220.0120.00716.71
8.3.210.0070.01116.50
8.3.200.0060.00216.57
8.3.190.0090.00517.36
8.3.180.0120.00617.00
8.3.170.0150.00416.64
8.3.160.0110.00716.63
8.3.150.0000.00817.30
8.3.140.0030.00517.02
8.3.130.0100.00718.32
8.3.120.0110.00720.65
8.3.110.0040.00420.94
8.3.100.0080.00024.06
8.3.90.0180.00026.77
8.3.80.0060.00318.56
8.3.70.0120.00916.58
8.3.60.0070.00716.63
8.3.50.0140.00420.20
8.3.40.0150.00422.15
8.3.30.0120.00318.48
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0090.00720.66
8.2.280.0140.00518.14
8.2.270.0030.00616.48
8.2.260.0090.00919.04
8.2.250.0040.00418.57
8.2.240.0040.00418.78
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0000.00826.77
8.2.200.0000.00916.75
8.2.190.0190.00316.75
8.2.180.0100.00725.92
8.2.170.0110.00418.94
8.2.160.0100.01022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.36
8.2.110.0030.00722.14
8.2.100.0090.00317.72
8.2.90.0080.00017.75
8.2.80.0040.00418.74
8.2.70.0080.00017.62
8.2.60.0050.00318.16
8.2.50.0040.00418.07
8.2.40.0000.00818.22
8.2.30.0030.00618.18
8.2.20.0000.00719.30
8.2.10.0040.00418.23
8.2.00.0080.00019.41
8.1.330.0150.00316.85
8.1.320.0090.01017.62
8.1.310.0070.01118.54
8.1.300.0090.00016.23
8.1.290.0100.00030.84
8.1.280.0070.01025.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0000.00920.61
8.1.230.0080.00417.77
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0090.00017.38
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0000.00818.46
8.1.160.0000.00918.88
8.1.150.0040.00418.68
8.1.140.0040.00417.38
8.1.130.0030.00318.80
8.1.120.0000.00717.46
8.1.110.0040.00417.43
8.1.100.0050.00317.42
8.1.90.0110.00617.46
8.1.80.0100.00617.44
8.1.70.0140.00217.46
8.1.60.0080.01117.59
8.1.50.0170.00217.42
8.1.40.0100.00917.51
8.1.30.0110.00817.66
8.1.20.0150.00417.58
8.1.10.0080.01017.36
8.1.00.0130.00417.45
8.0.300.0040.00418.77
8.0.290.0050.00316.63
8.0.280.0000.00718.44
8.0.270.0000.00717.99
8.0.260.0030.00318.45
8.0.250.0030.00316.91
8.0.240.0090.00216.82
8.0.230.0000.00816.86
8.0.220.0070.00516.82
8.0.210.0070.00716.65
8.0.200.0110.00316.84
8.0.190.0120.00216.79
8.0.180.0130.00316.84
8.0.170.0130.00316.84
8.0.160.0110.00416.79
8.0.150.0100.00516.81
8.0.140.0110.00416.77
8.0.130.0090.00716.75
8.0.120.0120.00216.78
8.0.110.0120.00416.75
8.0.100.0090.00616.77
8.0.90.0120.00416.79
8.0.80.0100.00716.78
8.0.70.0110.00416.78
8.0.60.0120.00316.88
8.0.50.0100.00516.75
8.0.30.0120.00316.86
8.0.20.0140.00316.77
8.0.10.0060.00917.02
7.4.330.0070.00015.55
7.4.320.0000.00616.51
7.4.300.0120.00316.55
7.4.290.0090.00916.56
7.4.280.0110.00616.39
7.4.270.0150.00216.55
7.4.260.0130.00416.56
7.4.250.0130.00316.53
7.4.240.0170.00016.56
7.4.230.0070.00616.56
7.4.220.0100.00516.56
7.4.210.0130.00216.43
7.4.200.0050.00616.46
7.4.190.0080.00516.60
7.4.180.0100.00516.54
7.4.160.0080.00316.52
7.4.150.0070.00416.49
7.4.140.0080.00416.28
7.4.130.0100.00216.36
7.4.120.0090.00316.47
7.4.110.0110.00316.43
7.4.100.0090.00516.53
7.4.90.0040.00916.40
7.4.80.0030.00716.50
7.4.70.0050.00516.47
7.4.60.0030.00816.34
7.4.50.0050.00716.36
7.4.40.0020.00816.38
7.4.30.0060.00516.47
7.4.20.0020.00516.41
7.4.10.0000.00716.38
7.4.00.0050.00316.49

preferences:
29.77 ms | 403 KiB | 5 Q