3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unset_by_array_value(array $array, array $values) { $value_keys = array_flip($array); foreach ($values as $value) { if isset($value_keys[$value]) { unset($array[$value_keys[$value]]); } } return $array; } $array = ['cheese', 'ham', 'bacon']; print_r(unset_by_array_value($array, ['ham']));

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)
5.6.70.3100.03320.36
5.4.390.0670.06018.91
5.4.380.0270.04018.69
5.4.370.0130.06318.46
5.4.360.0170.05318.75
5.4.350.0230.04718.72
5.4.340.0170.05318.64
5.4.320.0200.05018.61
5.4.310.0230.05018.79
5.4.300.0100.05718.74
5.4.290.0130.05018.75
5.4.280.0270.04018.48
5.4.270.0100.05718.73
5.4.260.0070.06018.62
5.4.250.0200.05018.68
5.4.240.0130.05318.63
5.4.230.0130.05318.73
5.4.220.0170.05018.73
5.4.210.0030.06318.71
5.4.200.0100.06016.61
5.4.190.0200.04718.60
5.4.180.0170.06018.54
5.4.170.0170.06018.60
5.4.160.0200.05018.58
5.4.150.0200.05318.44
5.4.140.0170.05716.19
5.4.130.0200.04716.29
5.4.120.0130.06316.28
5.4.110.0200.04716.29
5.4.100.0130.05316.45
5.4.90.0130.05016.23
5.4.80.0100.05316.26
5.4.70.0130.05716.23
5.4.60.0230.04716.17
5.4.50.0200.04316.20
5.4.40.0170.05316.30
5.4.30.0170.04716.23
5.4.20.0130.05316.39
5.4.10.0230.04016.38
5.4.00.0170.04715.69
5.3.290.0100.06014.69
5.3.280.0230.05714.53
5.3.270.0270.06314.66
5.3.260.0300.06714.63
5.3.250.0200.07014.66
5.3.240.0270.04314.61
5.3.230.0070.06314.70
5.3.220.0100.05714.61
5.3.210.0170.06014.67
5.3.200.0170.05314.60
5.3.190.0130.05314.79
5.3.180.0130.05314.70
5.3.170.0170.06714.68
5.3.160.0130.05314.75
5.3.150.0100.06014.75
5.3.140.0300.03314.69
5.3.130.0100.06714.77
5.3.120.0100.06014.77
5.3.110.0230.04714.59
5.3.100.0130.05014.08
5.3.90.0130.05014.02
5.3.80.0130.05014.19
5.3.70.0170.05714.06
5.3.60.0070.06014.17
5.3.50.0200.04713.98
5.3.40.0200.04313.93
5.3.30.0200.04313.91
5.3.20.0170.04713.67
5.3.10.0170.05013.73
5.3.00.0130.05013.80
5.2.170.0170.03711.18
5.2.160.0170.03711.25
5.2.150.0100.04711.24
5.2.140.0070.04711.20
5.2.130.0030.04711.16
5.2.120.0100.04011.12
5.2.110.0170.03711.30
5.2.100.0100.04011.32
5.2.90.0130.04311.20
5.2.80.0130.04011.20
5.2.70.0130.04011.11
5.2.60.0130.03711.27
5.2.50.0100.04011.12
5.2.40.0130.04011.03
5.2.30.0100.04011.11
5.2.20.0100.04011.14
5.2.10.0130.03710.86
5.2.00.0030.04710.82
5.1.60.0070.04010.03
5.1.50.0000.04010.02
5.1.40.0070.0379.96
5.1.30.0200.02310.47
5.1.20.0100.03710.46
5.1.10.0070.03710.27
5.1.00.0030.04010.27
5.0.50.0100.0308.58
5.0.40.0030.0308.45
5.0.30.0000.0578.31
5.0.20.0200.0208.20
5.0.10.0170.0238.37
5.0.00.0030.0478.23
4.4.90.0030.0276.45
4.4.80.0170.0206.45
4.4.70.0070.0236.45
4.4.60.0070.0236.45
4.4.50.0070.0206.45
4.4.40.0000.0406.45
4.4.30.0030.0236.45
4.4.20.0130.0136.45
4.4.10.0070.0206.45
4.4.00.0130.0276.45
4.3.110.0030.0236.45
4.3.100.0070.0206.45
4.3.90.0030.0236.45
4.3.80.0070.0336.45
4.3.70.0070.0206.45
4.3.60.0000.0276.45
4.3.50.0030.0236.45
4.3.40.0070.0306.45
4.3.30.0070.0206.45
4.3.20.0070.0206.45
4.3.10.0000.0236.45
4.3.00.0000.0237.61

preferences:
142.42 ms | 1394 KiB | 7 Q