3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ["a" => 2, "b" => 3, "c" => 1, "d" => 2]; $array2 = ["c" => 1, "d" => 1, "a" => 2, "b" => 3, "x" => 4, "z" => 1]; $count = 0; foreach($array1 as $key => $value){ $array_2_value = $array2[$key] ?? null; if($array_2_value !== null && $array_2_value === $value) $count++; } echo $count;

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.20.0100.01017.88
8.4.10.0120.00319.29
8.3.150.0060.00918.34
8.3.140.0150.00316.64
8.3.130.0060.00318.59
8.3.120.0060.00318.75
8.3.110.0000.00818.45
8.3.100.0030.00616.62
8.3.90.0050.00326.77
8.3.80.0070.00318.55
8.3.70.0090.01216.58
8.3.60.0110.00418.14
8.3.50.0330.00624.54
8.3.40.0070.00718.63
8.3.30.0120.00318.61
8.3.20.0000.00720.73
8.3.10.0080.00023.66
8.3.00.0080.00021.88
8.2.270.0090.00917.44
8.2.260.0080.00016.81
8.2.250.0040.00418.58
8.2.240.0040.00417.40
8.2.230.0000.00820.94
8.2.220.0030.00624.06
8.2.210.0080.00026.77
8.2.200.0060.00616.75
8.2.190.0140.00416.58
8.2.180.0040.01125.92
8.2.170.0070.00722.96
8.2.160.0040.01122.15
8.2.150.0000.01024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0100.00018.89
8.2.110.0070.00320.58
8.2.100.0070.00417.59
8.2.90.0040.00417.88
8.2.80.0080.00018.77
8.2.70.0040.00417.75
8.2.60.0040.00417.75
8.2.50.0040.00417.63
8.2.40.0000.01218.21
8.2.30.0000.00719.50
8.2.20.0040.00418.19
8.2.10.0040.00419.23
8.2.00.0000.00719.23
8.1.310.0040.00418.54
8.1.300.0090.00016.84
8.1.290.0100.00030.84
8.1.280.0090.00625.92
8.1.270.0080.00022.13
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00022.19
8.1.230.0090.00322.20
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00817.48
8.1.190.0080.00017.23
8.1.180.0060.00318.10
8.1.170.0030.00618.55
8.1.160.0040.00418.86
8.1.150.0040.00418.93
8.1.140.0030.00318.81
8.1.130.0000.00620.28
8.1.120.0000.00717.47
8.1.110.0040.00417.45
8.1.100.0030.00617.42
8.1.90.0000.00717.51
8.1.80.0000.00717.40
8.1.70.0000.00817.40
8.1.60.0030.00617.48
8.1.50.0030.00517.59
8.1.40.0040.00417.51
8.1.30.0000.00717.56
8.1.20.0040.00417.56
8.1.10.0040.00417.46
8.1.00.0000.00717.38
8.0.300.0060.00318.77
8.0.290.0030.00516.75
8.0.280.0000.00718.46
8.0.270.0000.00717.89
8.0.260.0030.00319.96
8.0.250.0070.00017.01
8.0.240.0000.00817.04
8.0.230.0040.00416.98
8.0.220.0030.00316.95
8.0.210.0000.00716.87
8.0.200.0070.00016.98
8.0.190.0040.00416.99
8.0.180.0050.00316.97
8.0.170.0030.00616.93
8.0.160.0000.00716.86
8.0.150.0040.00416.81
8.0.140.0070.00016.91
8.0.130.0050.00013.27
8.0.120.0000.00816.77
8.0.110.0000.00716.91
8.0.100.0030.00416.76
8.0.90.0060.00316.70
8.0.80.0070.01216.89
8.0.70.0040.00416.82
8.0.60.0000.00716.86
8.0.50.0000.00816.77
8.0.30.0130.00717.19
8.0.20.0090.01117.30
8.0.10.0000.00817.14
8.0.00.0190.00016.82
7.4.330.0050.00015.55
7.4.320.0000.00716.42
7.4.300.0030.00316.38
7.4.290.0000.00716.63
7.4.280.0060.00316.60
7.4.270.0030.00316.64
7.4.260.0000.00613.27
7.4.250.0040.00416.56
7.4.240.0000.00816.53
7.4.230.0030.00316.52
7.4.220.0050.00316.55
7.4.210.0060.01216.65
7.4.200.0030.00316.62
7.4.130.0120.00716.65
7.4.120.0150.00916.65
7.4.110.0090.00816.48
7.4.100.0030.01616.61
7.4.90.0060.01116.36
7.4.80.0100.01019.39
7.4.70.0100.01016.67
7.4.60.0070.01016.44
7.4.50.0120.00316.58
7.4.40.0090.00616.38
7.4.20.0150.00516.37
7.4.10.0060.01216.54
7.4.00.0100.00616.45
7.3.330.0030.00316.30
7.3.320.0000.00613.21
7.3.310.0000.00716.30
7.3.300.0070.00016.13
7.3.290.0100.00516.37
7.3.280.0080.00916.40
7.3.260.0170.00816.31
7.3.240.0060.01116.40
7.3.230.0040.01516.35
7.3.210.0100.00716.36
7.3.200.0100.00716.41
7.3.190.0040.01216.52
7.3.180.0060.01016.39
7.3.170.0110.00516.46
7.3.160.0000.01516.29
7.3.140.0000.01416.45
7.3.130.0110.00416.23
7.3.120.0150.00316.36
7.3.110.0060.00916.48
7.3.100.0120.00316.25
7.3.90.0040.01116.30
7.3.80.0130.00316.33
7.3.70.0100.00716.24
7.3.60.0110.00616.22
7.3.50.0180.00016.24
7.3.40.0100.00716.35
7.3.30.0120.00316.28
7.3.20.0070.00716.49
7.3.10.0070.00716.30
7.3.00.0180.00316.37
7.2.330.0160.00316.83
7.2.320.0070.01016.61
7.2.310.0130.00316.75
7.2.300.0040.01416.82
7.2.290.0060.01016.77
7.2.270.0070.01016.59
7.2.260.0100.00716.71
7.2.250.0090.00916.79
7.2.240.0040.01116.43
7.2.230.0090.00616.77
7.2.220.0130.00316.43
7.2.210.0000.02016.51
7.2.200.0030.01316.54
7.2.190.0110.00616.69
7.2.180.0030.01416.73
7.2.170.0040.01216.57
7.2.160.0080.00616.42
7.2.150.0120.00316.62
7.2.140.0040.01216.62
7.2.130.0090.00616.49
7.2.120.0090.00916.71
7.2.110.0100.01116.48
7.2.100.0130.00616.66
7.2.90.0100.00716.66
7.2.80.0160.00616.74
7.2.70.0060.01016.70
7.2.60.0060.01016.67
7.2.50.0090.01216.57
7.2.40.0060.01016.64
7.2.30.0040.01316.59
7.2.20.0170.00616.50
7.2.10.0070.01016.62
7.2.00.0080.00816.47

preferences:
126.51 ms | 403 KiB | 5 Q