3v4l.org

run code in 300+ PHP versions simultaneously
<?php $intersecting_arrays = Array ( 0 => Array ( 'one' => 10, 'two' => 20, 'three' => 50, 'four' => 80, 'five' => 100 ), 1 => Array ( 'three' => 20, 'five' => 20, 'six' => 100, 'seven' => 10 ), 2 => Array ( 'one' => 30, 'three' => 30, 'five' => 10, 'eight' => 10 ) ); $temp = $intersecting_arrays[0]; for($i = 1; $i < count($intersecting_arrays); $i++) { $temp = array_intersect_key($temp, $intersecting_arrays[$i]); } $result = Array(); foreach(array_keys($temp) as $key => $val) { $value = 0; foreach($intersecting_arrays as $val1) { $value+= $val1[$val]; } $result[$key] = $value / count($intersecting_arrays); } print_r($temp); print_r($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.3.60.0100.01016.50
8.3.50.0150.00016.51
8.3.40.0120.00618.70
8.3.30.0060.00918.67
8.3.20.0040.00420.16
8.3.10.0040.00423.66
8.3.00.0070.00023.70
8.2.180.0140.00016.63
8.2.170.0150.00022.96
8.2.160.0000.01420.41
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00422.29
8.2.120.0070.00026.35
8.2.110.0060.00320.97
8.2.100.0040.00817.91
8.2.90.0030.00617.62
8.2.80.0000.00920.64
8.2.70.0050.00517.63
8.2.60.0000.00817.63
8.2.50.0030.00617.75
8.2.40.0090.00019.48
8.2.30.0040.00421.16
8.2.20.0040.00418.20
8.2.10.0030.00618.07
8.2.00.0040.00418.01
8.1.280.0040.01125.92
8.1.270.0000.00823.77
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.01523.86
8.1.230.0080.00322.61
8.1.220.0000.00817.79
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0060.00317.22
8.1.180.0050.00518.10
8.1.170.0000.00718.89
8.1.160.0070.00018.97
8.1.150.0040.00419.00
8.1.140.0000.00817.72
8.1.130.0040.00418.90
8.1.120.0100.00017.50
8.1.110.0040.00417.38
8.1.100.0040.00417.51
8.1.90.0030.00417.43
8.1.80.0040.00417.51
8.1.70.0000.00817.42
8.1.60.0000.00817.61
8.1.50.0040.00417.44
8.1.40.0000.00817.52
8.1.30.0000.00717.64
8.1.20.0080.00017.66
8.1.10.0040.00417.64
8.1.00.0040.00417.53
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0000.00718.37
8.0.270.0050.00316.76
8.0.260.0000.00816.71
8.0.250.0000.00716.89
8.0.240.0000.00816.97
8.0.230.0000.00816.96
8.0.220.0030.00616.92
8.0.210.0000.00716.79
8.0.200.0000.00616.83
8.0.190.0070.00316.84
8.0.180.0040.00416.88
8.0.170.0070.00016.98
8.0.160.0000.00716.88
8.0.150.0070.00016.74
8.0.140.0070.00016.84
8.0.130.0030.00313.39
8.0.120.0070.00016.74
8.0.110.0050.00316.81
8.0.100.0080.00016.79
8.0.90.0000.00716.71
8.0.80.0060.00916.97
8.0.70.0060.00317.02
8.0.60.0020.00516.71
8.0.50.0080.00016.81
8.0.30.0130.00817.16
8.0.20.0120.00817.40
8.0.10.0000.00817.13
8.0.00.0140.00416.71
7.4.330.0000.00516.70
7.4.320.0000.00616.63
7.4.300.0070.00016.60
7.4.290.0000.00716.66
7.4.280.0030.00616.52
7.4.270.0070.00016.57
7.4.260.0000.00716.41
7.4.250.0000.00716.56
7.4.240.0000.00716.48
7.4.230.0040.00416.50
7.4.220.0230.00516.48
7.4.210.0100.01016.62
7.4.200.0000.00816.54
7.4.160.0080.00916.41
7.4.150.0000.01717.40
7.4.140.0040.01317.86
7.4.130.0030.01616.41
7.4.120.0110.00816.50
7.4.110.0060.01016.47
7.4.100.0120.00916.45
7.4.90.0090.00916.42
7.4.80.0160.00619.39
7.4.70.0090.01316.68
7.4.60.0100.00716.33
7.4.50.0070.00716.39
7.4.40.0000.01616.70
7.4.30.0070.01016.68
7.4.00.0030.01214.81
7.3.330.0050.00013.16
7.3.320.0030.00313.32
7.3.310.0040.00416.29
7.3.300.0000.00716.18
7.3.290.0040.01116.33
7.3.280.0090.00616.34
7.3.270.0140.00717.40
7.3.260.0060.01016.43
7.3.250.0110.00716.41
7.3.240.0110.00816.37
7.3.230.0130.00316.38
7.3.210.0130.00616.37
7.3.200.0110.00716.64
7.3.190.0090.00916.54
7.3.180.0120.01216.36
7.3.170.0060.01616.25
7.3.160.0050.01116.61
7.3.120.0090.00914.94
7.3.110.0120.00614.39
7.3.100.0070.00714.88
7.3.90.0080.00814.95
7.3.80.0030.01615.02
7.3.70.0060.01214.96
7.3.60.0060.00614.89
7.3.50.0030.00614.82
7.3.40.0040.01214.67
7.3.30.0070.00714.85
7.3.20.0000.01116.80
7.3.10.0080.00416.53
7.3.00.0030.01016.64
7.2.330.0030.01516.61
7.2.320.0060.00916.76
7.2.310.0120.01216.64
7.2.300.0100.00716.51
7.2.290.0070.01116.57
7.2.250.0030.01615.02
7.2.240.0140.00714.96
7.2.230.0090.00915.02
7.2.220.0000.01414.97
7.2.210.0100.00714.96
7.2.200.0090.00315.28
7.2.190.0030.00615.01
7.2.180.0060.00914.95
7.2.170.0030.01015.21
7.2.60.0090.00316.98
7.1.330.0080.00815.95
7.1.320.0070.00715.63
7.1.310.0090.00915.68
7.1.300.0000.01115.60
7.1.290.0100.00315.86
7.1.280.0090.00615.62
7.1.270.0000.00815.94
7.1.260.0040.00816.03
7.1.200.0230.00015.75
7.1.110.0070.01318.32
7.1.100.0100.00718.19
7.1.90.0070.01018.06
7.1.80.0030.01218.05
7.1.70.0100.01017.09
7.1.60.0140.02335.03
7.1.50.0170.02034.57
7.1.40.0290.01034.34
7.1.30.0250.01334.67
7.1.20.0260.01034.79
7.1.10.0090.00316.50
7.1.00.0130.00316.85
7.0.250.0110.00917.85
7.0.240.0070.01117.52
7.0.230.0090.00917.71
7.0.220.0040.01417.67
7.0.210.0110.00816.86
7.0.200.0070.01016.95
7.0.190.0100.00716.47
7.0.180.0030.01416.33
7.0.170.0060.01316.20
7.0.160.0100.01016.34
7.0.150.0030.01016.24
7.0.140.0070.01116.41
7.0.130.0070.01016.48
7.0.120.0110.00516.66
7.0.110.0120.00616.23
7.0.100.0060.00816.44
7.0.90.0080.00516.31
7.0.80.0100.00316.35
7.0.70.0080.01116.43
7.0.60.0030.01616.20
7.0.50.0000.01716.38
7.0.40.0060.01216.49
7.0.30.0190.00016.51
7.0.20.0030.01416.35
7.0.10.0130.00516.57
7.0.00.0090.00416.23

preferences:
85.45 ms | 400 KiB | 5 Q