3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits_arr = [ ['id' => 213, 'fruit' => 'banana'], ['id' => 438, 'fruit' => 'apple'], ['id' => 154, 'fruit' => 'peach'], ]; $ids_arr = [213, 154]; $selected_fruits = array_filter($fruits_arr, function ($el) use ($ids_arr) { return in_array($el['id'], $ids_arr, true); }); print_r($selected_fruits); $selected_fruits = array_filter($fruits_arr, fn ($el) => in_array($el['id'], $ids_arr, true)); print_r($selected_fruits);

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.10.0110.00716.55
8.5.00.0130.00920.15
8.4.150.0020.00014.05
8.4.140.0140.00917.55
8.4.130.0110.00917.57
8.4.120.0090.01023.85
8.4.110.0050.00423.29
8.4.100.0140.00818.76
8.4.90.0140.00618.90
8.4.80.0100.01017.73
8.4.70.0100.00617.91
8.4.60.0110.00920.54
8.4.50.0170.00618.53
8.4.40.0100.01020.52
8.4.30.0100.01023.99
8.4.20.0130.00718.86
8.4.10.0030.00617.84
8.3.280.0090.01118.64
8.3.270.0110.00916.71
8.3.260.0090.00716.99
8.3.250.0090.00518.84
8.3.240.0120.00617.41
8.3.230.0080.00016.49
8.3.220.0160.00318.98
8.3.210.0110.00816.80
8.3.200.0060.00316.66
8.3.190.0090.00617.05
8.3.180.0060.01317.37
8.3.170.0090.00620.70
8.3.160.0070.01116.60
8.3.150.0070.01117.20
8.3.140.0110.00716.39
8.3.130.0110.00418.33
8.3.120.0030.00618.80
8.3.110.0030.00620.94
8.3.100.0060.01324.06
8.3.90.0050.00326.77
8.3.80.0060.00318.31
8.3.70.0090.00616.63
8.3.60.0120.00318.27
8.3.50.0060.01021.06
8.3.40.0110.00418.71
8.3.30.0110.00418.71
8.3.20.0040.00423.65
8.3.10.0080.00020.21
8.3.00.0070.00023.56
8.2.290.0100.00720.45
8.2.280.0110.00818.45
8.2.270.0140.00017.20
8.2.260.0100.01020.82
8.2.250.0000.00818.14
8.2.240.0060.00617.18
8.2.230.0030.00622.58
8.2.220.0130.00737.54
8.2.210.0070.00726.77
8.2.200.0030.00618.41
8.2.190.0120.00616.58
8.2.180.0140.00717.00
8.2.170.0140.00722.96
8.2.160.0140.00020.58
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00026.16
8.2.110.0060.00320.38
8.2.100.0120.00017.97
8.2.90.0040.00417.84
8.2.80.0000.00817.75
8.2.70.0040.00417.63
8.2.60.0000.00818.03
8.2.50.0100.00718.07
8.2.40.0090.00020.07
8.2.30.0080.00018.07
8.2.20.0000.00718.14
8.2.10.0040.00419.33
8.2.00.0030.00519.32
8.1.330.0090.01521.82
8.1.320.0070.00416.45
8.1.310.0090.00016.07
8.1.300.0040.00418.32
8.1.290.0030.00718.88
8.1.280.0040.01125.92
8.1.270.0040.00422.00
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.86
8.1.230.0000.01123.89
8.1.220.0040.00417.79
8.1.210.0080.00019.00
8.1.200.0060.00317.35
8.1.190.0000.00917.35
8.1.180.0030.00518.10
8.1.170.0000.00818.61
8.1.160.0040.00418.81
8.1.150.0000.00718.77
8.1.140.0070.00022.06
8.1.130.0040.00417.48
8.1.120.0040.00417.54
8.1.110.0020.00517.50
8.1.100.0030.00617.34
8.1.90.0000.01017.36
8.1.80.0040.00417.48
8.1.70.0030.00317.50
8.1.60.0040.00417.53
8.1.50.0000.00717.52
8.1.40.0080.00017.45
8.1.30.0000.00917.66
8.1.20.0080.00017.55
8.1.10.0030.00617.48
8.1.00.0000.00817.48
8.0.300.0030.00619.95
8.0.290.0030.00516.63
8.0.280.0050.00218.42
8.0.270.0000.00716.79
8.0.260.0070.00016.83
8.0.250.0030.00616.84
8.0.240.0080.00016.93
8.0.230.0070.00016.93
8.0.220.0030.00316.88
8.0.210.0030.00616.88
8.0.200.0000.00716.80
8.0.190.0060.00316.94
8.0.180.0040.00416.81
8.0.170.0030.00616.84
8.0.160.0000.00716.85
8.0.150.0090.00316.75
8.0.140.0000.00716.84
8.0.130.0000.00613.34
8.0.120.0000.00716.84
8.0.110.0040.00416.96
8.0.100.0000.00716.68
8.0.90.0040.00416.81
8.0.80.0090.00716.90
8.0.70.0000.00716.81
8.0.60.0050.00216.92
8.0.50.0000.00716.98
8.0.30.0100.00917.06
8.0.20.0180.00616.97
8.0.10.0040.00417.09
8.0.00.0090.00916.64
7.4.330.0050.00015.55
7.4.320.0030.00316.57
7.4.300.0030.00316.61
7.4.290.0070.00016.45
7.4.280.0040.00416.60
7.4.270.0000.00716.51
7.4.260.0030.00316.59
7.4.250.0070.00016.40
7.4.240.0070.00016.42
7.4.230.0030.00316.73
7.4.220.0000.00616.41
7.4.210.0100.00616.56
7.4.200.0040.00416.69
7.4.130.0140.01016.31
7.4.120.0100.00716.57
7.4.110.0030.01416.60
7.4.100.0070.01116.50
7.4.90.0100.00616.65
7.4.80.0000.02019.39
7.4.70.0040.01316.48
7.4.60.0090.00616.53
7.4.50.0070.01016.50
7.4.40.0060.01016.35
7.3.330.0070.00012.97
7.3.320.0000.00513.09
7.3.310.0000.00716.26
7.3.300.0000.00616.01
7.3.290.0100.00716.17
7.3.280.0100.01016.19
7.3.260.0060.01316.22
7.3.240.0120.00916.31
7.3.230.0110.01116.14
7.3.210.0140.00616.35
7.3.200.0100.00816.15
7.3.190.0080.00816.17
7.3.180.0080.00816.21
7.3.170.0030.01416.23
7.3.160.0060.00916.45
7.3.70.0110.00514.55
7.3.60.0070.01014.37
7.3.50.0070.01314.57
7.3.40.0060.00914.20
7.3.30.0000.01314.42
7.3.20.0060.01214.68
7.3.10.0110.00714.63
7.3.00.0180.00314.63
7.2.330.0160.00316.46
7.2.320.0070.01116.18
7.2.310.0130.00316.43
7.2.300.0030.01316.41
7.2.290.0030.01516.17
7.2.200.0140.00314.50
7.2.190.0080.00314.59
7.2.180.0060.00614.61
7.2.170.0170.00714.62
7.2.160.0000.01314.53
7.2.150.0130.00714.53
7.2.140.0040.01614.78
7.2.130.0110.01114.78
7.2.120.0150.00614.65
7.2.110.0220.00314.38
7.2.100.0040.01514.82
7.2.90.0210.00414.75
7.2.80.0780.01214.68
7.2.70.0460.00614.93
7.2.60.0160.01314.65
7.2.50.0100.00714.55
7.2.40.0150.01214.91
7.2.30.0130.00314.64
7.2.20.0120.00914.89
7.2.10.0190.00014.88
7.2.00.0160.00614.76
7.1.300.0130.01013.69
7.1.290.0170.00713.65
7.1.280.0240.00313.43
7.1.270.0120.00613.51
7.1.260.0100.00713.63
7.1.250.0100.01013.50

preferences:
168.57 ms | 403 KiB | 5 Q