3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_subtract(array $source, array $subtractor) { foreach ($subtractor as $subtractorItem) { $subtractorKey = array_search($subtractorItem, $source, true); if ($subtractorKey !== false) { unset($source[$subtractorKey]); } } return array_values($source); } var_dump(array_subtract([ 't', 'e', 's', 't' ], [ 't' ])); // [ 'e', 's', 't' ] var_dump(array_subtract([ 't', 'e', 's', 't' ], [ 't', 't' ])); // [ 'e', 's' ] var_dump(array_subtract([ 't', 'e', 's', 't' ], [ 't', 'e', 's', 't' ])); // [] var_dump(array_subtract([ 't', 'e', 's', 't' ], [ 'x' ])); // [ 't', 'e', 's', 't' ]

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.5.00.0140.00720.05
8.4.150.0010.00014.05
8.4.140.0120.00817.31
8.4.130.0140.00617.53
8.4.120.0090.01220.35
8.4.110.0090.00918.51
8.4.100.0100.01017.56
8.4.90.0130.00720.70
8.4.80.0100.00918.96
8.4.70.0040.00418.95
8.4.60.0020.00620.84
8.4.50.0090.01118.94
8.4.40.0100.01018.86
8.4.30.0090.00920.50
8.4.20.0060.00317.95
8.4.10.0040.00420.52
8.3.280.0110.00920.08
8.3.270.0130.00816.70
8.3.260.0120.00716.67
8.3.250.0070.00419.06
8.3.240.0090.00916.64
8.3.230.0090.00916.66
8.3.220.0130.00618.98
8.3.210.0110.01016.57
8.3.200.0050.00316.59
8.3.190.0080.01117.20
8.3.180.0110.00918.68
8.3.170.0120.00617.32
8.3.160.0100.00717.12
8.3.150.0040.00416.75
8.3.140.0110.00716.43
8.3.130.0040.00416.87
8.3.120.0060.01318.95
8.3.110.0000.00820.94
8.3.100.0060.00324.06
8.3.90.0000.00826.77
8.3.80.0070.00316.63
8.3.70.0110.00716.63
8.3.60.0170.00316.63
8.3.50.0110.01123.78
8.3.40.0120.00621.86
8.3.30.0040.01118.38
8.3.20.0070.00024.18
8.3.10.0000.00824.66
8.3.00.0080.00026.16
8.2.290.0110.00720.55
8.2.280.0110.00818.24
8.2.270.0110.00316.50
8.2.260.0060.00917.19
8.2.250.0060.00316.70
8.2.240.0060.00317.15
8.2.230.0060.01222.58
8.2.220.0110.00337.54
8.2.210.0050.00326.77
8.2.200.0060.00316.88
8.2.190.0170.00316.75
8.2.180.0150.00325.92
8.2.170.0190.00319.09
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0050.00326.35
8.2.110.0070.00319.24
8.2.100.0030.00917.97
8.2.90.0080.00018.34
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0000.00818.02
8.2.50.0030.00618.05
8.2.40.0050.00322.30
8.2.30.0000.00718.00
8.2.20.0040.00418.00
8.2.10.0040.00419.18
8.2.00.0040.00419.21
8.1.330.0090.01016.27
8.1.320.0100.00916.01
8.1.310.0050.00318.46
8.1.300.0060.00318.05
8.1.290.0030.00718.88
8.1.280.0100.00725.92
8.1.270.0040.00823.99
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0030.00723.77
8.1.230.0040.00720.88
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00717.13
8.1.190.0000.00917.35
8.1.180.0050.00319.01
8.1.170.0030.00618.62
8.1.160.0000.00718.93
8.1.150.0040.00418.88
8.1.140.0000.00718.85
8.1.130.0000.01120.14
8.1.120.0000.00717.52
8.1.110.0050.00317.35
8.1.100.0000.00817.36
8.1.90.0000.00917.46
8.1.80.0000.00717.50
8.1.70.0000.00717.50
8.1.60.0060.00317.64
8.1.50.0060.00317.43
8.1.40.0040.00417.54
8.1.30.0000.00817.63
8.1.20.0000.00817.48
8.1.10.0030.00717.44
8.1.00.0050.00317.44
8.0.300.0060.00320.09
8.0.290.0050.00216.63
8.0.280.0030.00318.44
8.0.270.0000.00717.96
8.0.260.0030.00318.34
8.0.250.0000.00717.02
8.0.240.0030.00316.87
8.0.230.0000.00617.01
8.0.220.0030.00316.87
8.0.210.0080.00016.84
8.0.200.0080.00016.92
8.0.190.0000.00716.95
8.0.180.0000.00816.93
8.0.170.0040.00416.95
8.0.160.0000.00816.79
8.0.150.0030.00316.84
8.0.140.0060.00316.74
8.0.130.0030.00313.32
8.0.120.0050.00316.83
8.0.110.0080.00016.71
8.0.100.0040.00416.72
8.0.90.0030.00616.92
8.0.80.0070.01116.74
8.0.70.0000.00816.88
8.0.60.0040.00416.93
8.0.50.0050.00316.76
8.0.30.0100.01417.14
8.0.20.0080.01217.03
8.0.10.0020.00516.93
8.0.00.0120.00616.76
7.4.330.0000.00515.55
7.4.320.0000.00616.52
7.4.300.0000.00716.49
7.4.290.0040.00416.61
7.4.280.0050.00316.48
7.4.270.0050.00316.50
7.4.260.0000.00713.29
7.4.250.0000.00716.46
7.4.240.0000.00716.49
7.4.230.0000.00716.69
7.4.220.0050.00216.65
7.4.210.0060.01016.52
7.4.200.0000.00716.48
7.4.130.0120.01116.58
7.4.120.0110.00816.58
7.4.110.0090.00916.40
7.4.100.0140.01016.52
7.4.90.0140.00316.31
7.4.80.0130.00416.48
7.4.70.0110.00716.35
7.4.60.0090.00916.42
7.4.50.0060.01016.45
7.4.40.0120.00616.55
7.4.30.0140.00316.55
7.4.20.0080.01216.38
7.4.10.0070.01116.39
7.4.00.0060.00916.34
7.3.330.0030.00316.31
7.3.320.0000.00613.37
7.3.310.0030.00416.23
7.3.300.0070.00016.24
7.3.290.0080.00916.37
7.3.260.0090.00916.36
7.3.230.0130.00316.32
7.3.220.0070.01016.45
7.3.210.0060.01216.31
7.3.200.0140.00316.28
7.3.190.0040.01416.29
7.3.180.0110.00616.20
7.3.170.0070.01016.37
7.3.160.0040.01216.59
7.3.150.0070.01116.39
7.3.140.0110.00816.48
7.3.130.0090.00616.48
7.3.120.0030.01216.27
7.3.110.0100.00716.35
7.3.100.0170.00016.32
7.3.90.0120.00616.35
7.3.80.0040.01616.21
7.3.70.0080.01116.42
7.3.60.0080.00916.52
7.3.50.0120.00616.23
7.3.40.0110.00616.47
7.3.30.0040.01116.39
7.3.20.0090.01016.28
7.3.10.0200.00016.38
7.3.00.0030.01616.25
7.2.340.0100.00716.48
7.2.330.0060.01216.61
7.2.320.0110.00716.70
7.2.310.0050.01316.64
7.2.300.0070.01016.66
7.2.290.0070.01116.34
7.2.280.0060.01216.78
7.2.270.0080.00916.79
7.2.260.0100.00616.55
7.2.250.0030.01316.75
7.2.240.0080.00816.61
7.2.230.0060.01216.53
7.2.220.0080.00816.66
7.2.210.0160.00016.52
7.2.200.0150.00316.70
7.2.190.0090.00916.66
7.2.180.0090.00916.62
7.2.170.0070.01016.73
7.2.160.0130.00416.66
7.2.150.0150.00416.79
7.2.140.0110.00716.58
7.2.130.0130.00616.63
7.2.120.0100.00716.65
7.2.110.0120.01216.54
7.2.100.0090.00916.72
7.2.90.0060.01316.52
7.2.80.0090.00916.57
7.2.70.0140.00516.52
7.2.60.0110.00816.63
7.2.50.0150.00416.65
7.2.40.0080.01116.69
7.2.30.0060.01316.52
7.2.20.0090.00916.58
7.2.10.0040.02016.60
7.2.00.0150.00316.60

preferences:
30.68 ms | 403 KiB | 5 Q