3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['keepThis', 'remove', false, 'keep', 'save', 'delete']; $array2 = ['hangOnto', 'remove', null, 'retain', 'keep', 'delete', 'extra']; $clean1 = $array1; $clean2 = array_diff_ukey( $array2, $array1, // Need to have "&" so the values get set. function($a, $b) use (&$clean1, $array1, $array2) { echo "a = $a, b = $b\n"; // Use isset() just in case keys are not identical // or arrays are not the same length. if (isset($array2[$b]) && $array2[$b] === $array1[$b]) { unset($clean1[$b]); } return strcmp($array2[$a], $array1[$b]); }); print_r($clean1); print_r($clean2);

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.0080.00816.88
8.3.50.0100.00618.42
8.3.40.0080.00818.83
8.3.30.0070.00719.23
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0000.00826.16
8.2.180.0120.00325.92
8.2.170.0070.00719.00
8.2.160.0080.00622.96
8.2.150.0030.00525.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0060.00322.30
8.2.100.0120.00017.97
8.2.90.0040.00417.88
8.2.80.0000.00818.05
8.2.70.0060.00617.34
8.2.60.0000.00817.63
8.2.50.0000.00817.98
8.2.40.0080.00018.22
8.2.30.0030.00618.05
8.2.20.0080.00020.41
8.2.10.0040.00418.20
8.2.00.0090.00019.37
8.1.270.0040.00421.95
8.1.260.0080.00026.35
8.1.250.0100.00028.09
8.1.240.0090.00022.71
8.1.230.0070.00419.02
8.1.220.0050.00317.78
8.1.210.0080.00018.77
8.1.200.0000.00817.48
8.1.190.0000.00917.35
8.1.180.0080.00018.10
8.1.170.0080.00017.62
8.1.160.0000.00718.94
8.1.150.0050.00318.57
8.1.140.0040.00417.40
8.1.130.0000.00718.96
8.1.120.0000.00917.36
8.1.110.0070.00017.48
8.1.100.0040.00417.47
8.1.90.0040.00417.50
8.1.80.0000.00817.36
8.1.70.0030.00317.48
8.1.60.0000.00817.62
8.1.50.0230.00017.36
8.1.40.0220.00317.53
8.1.30.0170.00617.65
8.1.20.0200.00017.66
8.1.10.0230.00417.61
8.1.00.0230.00317.50
8.0.300.0070.00019.77
8.0.290.0060.00316.75
8.0.280.0000.00718.36
8.0.270.0000.00716.88
8.0.260.0030.00318.42
8.0.250.0000.00716.95
8.0.240.0020.00517.04
8.0.230.0050.00217.04
8.0.220.0070.00016.91
8.0.210.0000.00716.96
8.0.200.0000.00717.02
8.0.190.0070.00016.92
8.0.180.0060.00316.99
8.0.170.0130.00816.98
8.0.160.0160.00416.91
8.0.150.0170.00416.75
8.0.140.0170.00616.81
8.0.130.0160.00616.90
8.0.120.0220.00017.00
8.0.110.0140.00716.78
8.0.100.0170.00616.92
8.0.90.0110.01116.85
8.0.80.0160.00616.89
8.0.70.0230.00016.79
8.0.60.0210.00316.85
8.0.50.0200.00316.86
8.0.30.0230.00316.96
8.0.20.0210.00016.94
8.0.10.0120.00917.09
7.4.330.0000.00515.55
7.4.320.0000.00716.52
7.4.300.0040.00416.51
7.4.290.0180.00616.45
7.4.280.0180.00516.46
7.4.270.0230.00016.52
7.4.260.0160.00616.35
7.4.250.0170.00416.50
7.4.240.0160.00416.52
7.4.230.0090.00716.58
7.4.220.0130.00716.56
7.4.210.0120.00916.40
7.4.200.0200.00016.49
7.4.190.0090.01316.50
7.4.180.0170.00616.56
7.4.160.0180.00016.48
7.4.150.0140.00716.60
7.4.140.0180.00316.47
7.4.130.0140.00716.57
7.4.120.0200.00016.47
7.4.110.0130.01016.36
7.4.100.0120.00916.61
7.4.90.0170.00316.50
7.4.80.0200.00016.52
7.4.70.0210.00016.50
7.4.60.0150.00616.31
7.4.50.0130.00016.39
7.4.40.0090.00616.24
7.4.30.0170.00016.31
7.4.20.0140.00716.41
7.4.10.0180.00416.45
7.4.00.0040.01516.61

preferences:
52.89 ms | 400 KiB | 5 Q