3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_greedy_diff($x, $y) { $output = $x; for($i = $j = 0; $i < count($x) && j < count($y); ) { if ($x[i] == $y[j]) { unset($output[i]); $x++; } $j++; } return $output; } $a = array(1,2,3,1,2,3); $b = array(1,2,3); var_dump(array_greedy_diff($a, $b));

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.0030.01016.63
8.3.50.0080.00822.04
8.3.40.0100.00718.73
8.3.30.0100.00719.17
8.3.20.0020.00520.33
8.3.10.0040.00421.69
8.3.00.0000.00818.16
8.2.180.0030.01218.41
8.2.170.0000.01422.96
8.2.160.0130.00320.50
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0050.00326.16
8.2.120.0080.00020.97
8.2.110.0030.00622.26
8.2.100.0060.00618.03
8.2.90.0000.00817.97
8.2.80.0040.00417.97
8.2.70.0000.00817.38
8.2.60.0090.00018.03
8.2.50.0050.00318.07
8.2.40.0040.00418.28
8.2.30.0040.00418.14
8.2.20.0000.00717.72
8.2.10.0020.00518.06
8.2.00.0040.00417.93
8.1.280.0070.01125.92
8.1.270.0040.00423.73
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00022.42
8.1.230.0030.00720.97
8.1.220.0050.00317.74
8.1.210.0060.00318.95
8.1.200.0060.00617.23
8.1.190.0050.00317.36
8.1.180.0050.00318.10
8.1.170.0000.00818.63
8.1.160.0050.00321.96
8.1.150.0040.00418.89
8.1.140.0000.00717.32
8.1.130.0040.00417.75
8.1.120.0040.00417.51
8.1.110.0060.00317.32
8.1.100.0040.00417.37
8.1.90.0030.00317.35
8.1.80.0000.00717.46
8.1.70.0070.00017.34
8.1.60.0030.00517.63
8.1.50.0040.00417.54
8.1.40.0030.00617.43
8.1.30.0080.00017.67
8.1.20.0030.00617.63
8.1.10.0000.00817.60
8.1.00.0060.00317.46
8.0.300.0040.00420.02
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0040.00417.15
8.0.260.0030.00317.27
8.0.250.0070.00016.97
8.0.240.0040.00417.07
8.0.230.0050.00316.89
8.0.220.0070.00016.95
8.0.210.0030.00316.96
8.0.200.0040.00416.95
8.0.190.0000.00717.01
8.0.180.0040.00416.94
8.0.170.0040.00417.05
8.0.160.0040.00416.90
8.0.150.0030.00316.93
8.0.140.0070.00016.82
8.0.130.0000.00713.38
8.0.120.0040.00416.86
8.0.110.0030.00316.88
8.0.100.0070.00016.92
8.0.90.0070.00016.91
8.0.80.0160.00817.01
8.0.70.0050.00316.95
8.0.60.0000.00816.77
8.0.50.0040.00416.83
8.0.30.0130.00617.05
8.0.20.0090.01017.40
8.0.10.0040.00416.94
8.0.00.0070.01516.70
7.4.330.0050.00015.00
7.4.320.0000.00816.34
7.4.300.0000.00816.49
7.4.290.0080.00016.49
7.4.280.0000.00716.38
7.4.270.0000.01016.40
7.4.260.0070.00316.30
7.4.250.0060.00316.38
7.4.240.0040.00316.49
7.4.230.0000.00716.41
7.4.220.0160.01316.59
7.4.210.0070.00716.52
7.4.200.0040.00416.23
7.4.160.0130.00716.44
7.4.150.0210.00917.40
7.4.140.0130.01317.86
7.4.130.0050.01316.47
7.4.120.0200.01416.39
7.4.110.0060.01216.43
7.4.100.0120.01216.55
7.4.90.0160.00316.41
7.4.80.0100.02319.39
7.4.70.0040.01516.44
7.4.60.0140.00316.54
7.4.50.0060.00316.05
7.4.40.0120.01216.45
7.4.30.0150.01516.27
7.4.00.0040.01214.88
7.3.330.0050.00013.39
7.3.320.0000.00613.46
7.3.310.0060.00016.18
7.3.300.0080.00016.27
7.3.290.0120.00616.34
7.3.280.0130.00716.34
7.3.270.0230.01017.40
7.3.260.0080.02916.36
7.3.250.0240.00916.29
7.3.240.0340.01716.35
7.3.230.0250.01016.47
7.3.210.0090.00916.45
7.3.200.0270.00719.39
7.3.190.0160.01416.32
7.3.180.0110.01616.59
7.3.170.0080.01116.33
7.3.160.0290.00416.47
7.3.120.0030.01414.78
7.2.330.0200.00716.47
7.2.320.0170.01216.77
7.2.310.0070.01016.48
7.2.300.0180.01416.50
7.2.290.0250.01516.51
7.2.60.0060.00617.00
7.2.00.0000.01319.36
7.1.200.0110.00415.67
7.1.100.0040.01118.03
7.1.70.0040.00417.09
7.1.60.0070.01719.25
7.1.50.0030.00716.98
7.1.00.0030.07322.45
7.0.200.0000.01116.64
7.0.140.0030.07021.97
7.0.100.0100.03320.19
7.0.90.0070.08319.94
7.0.80.0070.05320.01
7.0.70.0230.06319.89
7.0.60.0070.07319.87
7.0.50.0200.06320.37
7.0.40.0030.09320.13
7.0.30.0070.08720.05
7.0.20.0100.06320.09
7.0.10.0030.05320.07
7.0.00.0000.05320.17
5.6.280.0100.06721.10
5.6.250.0030.05320.82
5.6.240.0030.05720.69
5.6.230.0170.05720.58
5.6.220.0100.05020.71
5.6.210.0100.07320.55
5.6.200.0070.07321.04
5.6.190.0200.04021.04
5.6.180.0070.05021.04
5.6.170.0130.06021.06
5.6.160.0070.07021.04
5.6.150.0130.05021.04
5.6.140.0100.04320.91
5.6.130.0070.09021.03
5.6.120.0130.07720.98
5.6.110.0070.05021.11
5.6.100.0130.08021.04
5.6.90.0130.05320.91
5.6.80.0070.04320.39
5.6.70.0070.07320.40
5.6.60.0070.05720.41
5.6.50.0070.06320.34
5.6.40.0000.04320.46
5.6.30.0030.05320.50
5.6.20.0100.06720.31
5.6.10.0100.03320.31
5.6.00.0030.04720.28
5.5.380.0070.03320.35
5.5.370.0000.04320.55
5.5.360.0030.06020.35
5.5.350.0100.04720.46
5.5.340.0070.05720.78
5.5.330.0070.04020.80
5.5.320.0030.04320.91
5.5.310.0170.06020.91
5.5.300.0030.04320.88
5.5.290.0070.05320.83
5.5.280.0170.04720.83
5.5.270.0030.04320.92
5.5.260.0100.03720.86
5.5.250.0030.04320.70
5.5.240.0070.06320.30
5.5.230.0030.08720.02
5.5.220.0100.04320.14
5.5.210.0100.03320.28
5.5.200.0030.04020.22
5.5.190.0030.08020.18
5.5.180.0100.03320.13
5.5.160.0030.08020.23
5.5.150.0030.08020.23
5.5.140.0100.07020.23
5.5.130.0130.04320.26
5.5.120.0070.07720.11
5.5.110.0070.03720.27
5.5.100.0000.04320.18
5.5.90.0000.05720.06
5.5.80.0030.06720.06
5.5.70.0100.08020.00
5.5.60.0070.07720.12
5.5.50.0000.05320.08
5.5.40.0070.04020.00
5.5.30.0030.04020.09
5.5.20.0000.04019.89
5.5.10.0070.03319.97
5.5.00.0070.04720.01
5.4.450.0070.04019.38
5.4.440.0100.04319.47
5.4.430.0000.04719.13
5.4.420.0100.03719.29
5.4.410.0170.06319.18
5.4.400.0070.07018.96
5.4.390.0030.07718.95
5.4.380.0030.05718.98
5.4.370.0070.08018.96
5.4.360.0100.07718.96
5.4.350.0070.05718.83
5.4.340.0100.06718.96
5.4.320.0070.06318.85
5.4.310.0070.05719.03
5.4.300.0070.07019.11
5.4.290.0030.04018.99
5.4.280.0070.07718.88
5.4.270.0070.04719.14
5.4.260.0000.05019.14
5.4.250.0100.07319.13
5.4.240.0000.05718.89
5.4.230.0130.07318.95
5.4.220.0000.06318.78
5.4.210.0070.03718.82
5.4.200.0070.04018.95
5.4.190.0170.04018.95
5.4.180.0070.03318.91
5.4.170.0030.04318.81
5.4.160.0070.07018.90
5.4.150.0030.03718.77
5.4.140.0100.06716.25
5.4.130.0070.05016.38
5.4.120.0130.06016.24
5.4.110.0100.06716.48
5.4.100.0100.07016.37
5.4.90.0130.05716.32
5.4.80.0130.06016.25
5.4.70.0070.06016.24
5.4.60.0030.03316.31
5.4.50.0030.06316.28
5.4.40.0000.05016.41
5.4.30.0070.03316.38
5.4.20.0100.04016.28
5.4.10.0030.03716.22
5.4.00.0030.03715.71
5.3.290.0130.03015.71
5.3.280.0030.04715.71
5.3.270.0030.04715.71
5.3.260.0100.07715.71
5.3.250.0070.07315.71
5.3.240.0030.06015.71
5.3.230.0070.07315.71
5.3.220.0000.05315.71
5.3.210.0100.06015.71
5.3.200.0000.07015.71
5.3.190.0070.08015.71
5.3.180.0030.03715.71
5.3.170.0100.07715.71
5.3.160.0070.08015.71
5.3.150.0030.04015.71
5.3.140.0030.08015.71
5.3.130.0130.06015.71
5.3.120.0130.02715.71
5.3.110.0100.03315.71
5.3.100.0000.03315.71
5.3.90.0070.03015.71
5.3.80.0070.02715.71
5.3.70.0030.03015.71
5.3.60.0070.02715.71
5.3.50.0030.03315.71
5.3.40.0070.02715.71
5.3.30.0070.02715.71
5.3.20.0100.02715.71
5.3.10.0000.06715.71
5.3.00.0030.03015.71
5.2.170.0000.02715.71
5.2.160.0070.03715.71
5.2.150.0000.03015.71
5.2.140.0000.02715.71
5.2.130.0000.02715.71
5.2.120.0000.03015.71
5.2.110.0030.02315.71
5.2.100.0000.04015.71
5.2.90.0030.06015.71
5.2.80.0000.05315.71
5.2.70.0100.03715.71
5.2.60.0000.02715.71
5.2.50.0030.03015.71
5.2.40.0000.02715.71
5.2.30.0030.03315.71
5.2.20.0030.02715.71
5.2.10.0030.03015.71
5.2.00.0170.01715.71
5.1.60.0000.02315.71
5.1.50.0100.01315.71
5.1.40.0070.01715.71
5.1.30.0030.02315.71
5.1.20.0030.02715.71
5.1.10.0030.02015.71
5.1.00.0030.02715.71
5.0.50.0000.02015.71
5.0.40.0030.01715.71
5.0.30.0030.03015.71
5.0.20.0000.01715.71
5.0.10.0070.01015.71
5.0.00.0000.02715.71
4.4.90.0030.01315.71
4.4.80.0030.01015.71
4.4.70.0030.01315.71
4.4.60.0000.02315.71
4.4.50.0000.01715.71
4.4.40.0000.02315.71
4.4.30.0000.01715.71
4.4.20.0000.01715.71
4.4.10.0000.01315.71
4.4.00.0000.02315.71
4.3.110.0070.01315.71
4.3.100.0030.01315.71
4.3.90.0000.01315.71
4.3.80.0000.03015.71
4.3.70.0000.01315.71
4.3.60.0000.01315.71
4.3.50.0000.01715.71
4.3.40.0000.02315.71
4.3.30.0030.01315.71
4.3.20.0030.01015.71
4.3.10.0000.01315.71
4.3.00.0000.01315.71

preferences:
41.36 ms | 401 KiB | 5 Q