3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['keepThis', 'remove', false, 'keep', 'save', 'delete', 'extra']; $array2 = ['hangOnto', 'remove', null, 'retain', 'keep', 'delete']; $clean1 = $array1; $clean2 = array_diff_ukey( $array2, $array1, // Need to have "&" so the values get set. function($a, $b) use (&$clean1, $array1, $array2) { // 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.0120.00317.00
8.3.50.0100.00718.42
8.3.40.0140.00718.88
8.3.30.0070.00719.09
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.180.0100.00725.92
8.2.170.0070.00719.09
8.2.160.0150.00322.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0060.00322.25
8.2.100.0000.01117.84
8.2.90.0040.00417.91
8.2.80.0000.00819.34
8.2.70.0080.00017.63
8.2.60.0030.00617.93
8.2.50.0000.00817.98
8.2.40.0000.00818.34
8.2.30.0000.00818.18
8.2.20.0030.00520.50
8.2.10.0000.00818.19
8.2.00.0000.00819.22
8.1.280.0100.01025.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0140.00428.09
8.1.240.0040.00422.20
8.1.230.0000.01120.88
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0030.00617.35
8.1.190.0080.00017.22
8.1.180.0030.00518.10
8.1.170.0000.00917.62
8.1.160.0020.00518.86
8.1.150.0000.00718.69
8.1.140.0050.00217.46
8.1.130.0040.00417.37
8.1.120.0000.00717.45
8.1.110.0030.00317.34
8.1.100.0000.00817.43
8.1.90.0040.00417.36
8.1.80.0040.00417.46
8.1.70.0030.00317.47
8.1.60.0030.00617.63
8.1.50.0170.00517.45
8.1.40.0170.00817.39
8.1.30.0220.00517.53
8.1.20.0170.00617.55
8.1.10.0110.00417.52
8.1.00.0240.00517.53
8.0.300.0030.00420.04
8.0.290.0030.00616.63
8.0.280.0080.00018.46
8.0.270.0070.00016.82
8.0.260.0040.00416.75
8.0.250.0060.00016.84
8.0.240.0030.00317.00
8.0.230.0040.00416.91
8.0.220.0030.00316.88
8.0.210.0000.00716.76
8.0.200.0030.00316.86
8.0.190.0040.00416.96
8.0.180.0050.00216.90
8.0.170.0190.00116.85
8.0.160.0140.00716.87
8.0.150.0170.00316.79
8.0.140.0090.01216.73
8.0.130.0160.00616.80
8.0.120.0150.00616.81
8.0.110.0150.00516.85
8.0.100.0200.00116.88
8.0.90.0160.00616.88
8.0.80.0130.00916.82
8.0.70.0130.00916.76
8.0.60.0150.00516.85
8.0.50.0190.00316.80
8.0.30.0170.00416.82
8.0.20.0140.00816.87
8.0.10.0120.01016.94
7.4.330.0000.00515.55
7.4.320.0030.00316.43
7.4.300.0000.00616.61
7.4.290.0170.00616.53
7.4.280.0200.00516.55
7.4.270.0120.01116.58
7.4.260.0180.00516.55
7.4.250.0140.00516.52
7.4.240.0100.00216.54
7.4.230.0140.00516.53
7.4.220.0160.00216.59
7.4.210.0110.00616.47
7.4.200.0190.00216.54
7.4.190.0190.00216.57
7.4.180.0150.00316.60
7.4.160.0110.00416.58
7.4.150.0120.00616.39
7.4.140.0120.00416.31
7.4.130.0130.00316.47
7.4.120.0140.00516.41
7.4.110.0160.00316.47
7.4.100.0140.00616.56
7.4.90.0140.00816.43
7.4.80.0160.00516.41
7.4.70.0150.00716.35
7.4.60.0150.00716.38
7.4.50.0110.00616.45
7.4.40.0090.01016.35
7.4.30.0110.00716.41
7.4.20.0140.00716.31
7.4.10.0150.00416.47
7.4.00.0150.00516.48

preferences:
52.85 ms | 401 KiB | 5 Q