3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [1, 3, 3, 3, 4, 7, 7, 8, 8]; $array2 = [0, 3, 3, 4, 4, 9, 9, 9]; $counts1 = array_count_values($array1); $counts2 = array_count_values($array2); $keepFrom1 = array_keys( array_filter( $counts1, fn($count, $number) => ($counts2[$number] ?? 0) <= $count, ARRAY_FILTER_USE_BOTH ) ); var_export( array_merge( array_intersect($array1, $keepFrom1), array_diff($array2, $keepFrom1) ) );

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.0150.00617.83
8.4.130.0060.00317.49
8.4.120.0130.00820.48
8.4.110.0090.00819.03
8.4.100.0070.00818.88
8.4.90.0100.00720.58
8.4.80.0120.00917.74
8.4.70.0090.01218.11
8.4.60.0100.01020.34
8.4.50.0160.00417.87
8.4.40.0100.01017.84
8.4.30.0110.01118.61
8.4.20.0040.00417.73
8.4.10.0050.00521.86
8.3.270.0090.01016.69
8.3.260.0120.00616.67
8.3.250.0130.00618.95
8.3.240.0050.00316.52
8.3.230.0150.00616.38
8.3.220.0120.00719.04
8.3.210.0070.01016.50
8.3.200.0060.00316.84
8.3.190.0090.00917.22
8.3.180.0130.00616.44
8.3.170.0110.00716.96
8.3.160.0000.00916.68
8.3.150.0110.00718.31
8.3.140.0090.00917.11
8.3.130.0040.00418.45
8.3.120.0060.00320.53
8.3.110.0060.00320.94
8.3.100.0040.00424.06
8.3.90.0090.00926.77
8.3.80.0040.00716.50
8.3.70.0140.00416.58
8.3.60.0150.00018.31
8.3.50.0100.01018.54
8.3.40.0110.00720.52
8.3.30.0040.01118.70
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.290.0120.00720.57
8.2.280.0120.00522.10
8.2.270.0100.01018.96
8.2.260.0160.00316.52
8.2.250.0040.01118.22
8.2.240.0090.00018.84
8.2.230.0040.00422.58
8.2.220.0000.00837.54
8.2.210.0100.00326.77
8.2.200.0060.00316.50
8.2.190.0080.00816.63
8.2.180.0090.00625.92
8.2.170.0040.01119.09
8.2.160.0130.00022.96
8.2.150.0040.00425.66
8.2.140.0030.00524.66
8.2.130.0000.00726.16
8.2.120.0080.00026.16
8.2.110.0030.00720.90
8.2.100.0060.00617.84
8.2.90.0040.00417.75
8.2.80.0000.00818.77
8.2.70.0050.00317.38
8.2.60.0030.00717.50
8.2.50.0000.00817.55
8.2.40.0000.00818.28
8.2.30.0000.00718.14
8.2.20.0000.00719.32
8.2.10.0070.00018.15
8.2.00.0000.00719.43
8.1.330.0130.00621.88
8.1.320.0150.00516.09
8.1.310.0070.01018.41
8.1.300.0120.00618.40
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00317.48
8.1.230.0040.00720.89
8.1.220.0030.00518.52
8.1.210.0050.00318.77
8.1.200.0040.00417.38
8.1.190.0030.00517.23
8.1.180.0070.00018.10
8.1.170.0060.00317.62
8.1.160.0000.00719.08
8.1.150.0060.00318.58
8.1.140.0080.00017.50
8.1.130.0050.00317.51
8.1.120.0030.00317.37
8.1.110.0040.00417.36
8.1.100.0070.00417.34
8.1.90.0100.00517.43
8.1.80.0080.00817.46
8.1.70.0140.00317.38
8.1.60.0040.01517.41
8.1.50.0030.00617.56
8.1.40.0160.00317.56
8.1.30.0140.00717.54
8.1.20.0100.01017.42
8.1.10.0140.00417.44
8.1.00.0150.00417.34
8.0.300.0060.00318.77
8.0.290.0070.00016.63
8.0.280.0030.00318.44
8.0.270.0030.00316.76
8.0.260.0000.00618.45
8.0.250.0040.00416.91
8.0.240.0030.00616.92
8.0.230.0110.00516.87
8.0.220.0170.00016.84
8.0.210.0100.00716.66
8.0.200.0140.00316.80
8.0.190.0170.00016.79
8.0.180.0050.01016.74
8.0.170.0070.01016.92
8.0.160.0120.00416.71
8.0.150.0120.00416.84
8.0.140.0100.00516.77
8.0.130.0160.00016.76
8.0.120.0110.00516.66
8.0.110.0100.00816.77
8.0.100.0150.00416.74
8.0.90.0180.00016.80
8.0.80.0120.00416.73
8.0.70.0080.00916.86
8.0.60.0140.00316.90
8.0.50.0110.00516.84
8.0.30.0180.00016.71
8.0.20.0120.00516.99
8.0.10.0090.00616.97
7.4.330.0050.00015.55
7.4.320.0040.00416.52
7.4.300.0140.00016.53
7.4.290.0100.00716.45
7.4.280.0150.00416.59
7.4.270.0140.00316.39
7.4.260.0140.00416.39
7.4.250.0180.00316.56
7.4.240.0100.00716.30
7.4.230.0130.00316.59
7.4.220.0040.00816.48
7.4.210.0100.00016.47
7.4.200.0110.00316.44
7.4.190.0080.00816.41
7.4.180.0130.00316.59
7.4.160.0090.00616.55
7.4.150.0140.00316.31
7.4.140.0060.01016.52
7.4.130.0130.00316.45
7.4.120.0060.01116.47
7.4.110.0060.00916.32
7.4.100.0000.01516.40
7.4.90.0110.00416.41
7.4.80.0100.00516.45
7.4.70.0080.00816.33
7.4.60.0070.00816.44
7.4.50.0120.00316.37
7.4.40.0130.00516.42
7.4.30.0100.00516.34
7.4.20.0070.00716.21
7.4.10.0120.00416.48
7.4.00.0130.00216.55

preferences:
30.24 ms | 403 KiB | 5 Q