3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filter($array, $like, $kol) { $filtered = array_filter($array, function ($item) use ($kol, $like) { if (array_key_exists($kol, $item)) { return $item[$kol] === $like; } return false; }); return array_values($filtered); } $array = [ ["a" => "test"], ["b" => "test2"], ["c" => "test"] ]; print_r(filter($array, "test", "b")); print_r(filter($array, "test2", "b"));

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.4.20.0060.01320.58
8.4.10.0000.01520.73
8.3.150.0120.00617.20
8.3.140.0040.00416.79
8.3.130.0090.00016.71
8.3.120.0040.01119.05
8.3.110.0160.00320.94
8.3.100.0120.00318.34
8.3.90.0080.00026.77
8.3.80.0030.00616.50
8.3.70.0140.00716.63
8.3.60.0140.00718.28
8.3.50.0140.01023.78
8.3.40.0150.00718.69
8.3.30.0070.00718.61
8.3.20.0050.00324.18
8.3.10.0000.00724.66
8.3.00.0090.00026.16
8.2.270.0110.00417.01
8.2.260.0030.00616.92
8.2.250.0080.00016.85
8.2.240.0000.00916.86
8.2.230.0030.00522.58
8.2.220.0080.00024.06
8.2.210.0050.00326.77
8.2.200.0100.00016.63
8.2.190.0150.00616.63
8.2.180.0090.00625.92
8.2.170.0040.01118.77
8.2.160.0070.00722.96
8.2.150.0060.00325.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0030.00620.52
8.2.100.0040.00819.45
8.2.90.0040.00417.75
8.2.80.0040.00418.77
8.2.70.0110.00348.56
8.2.60.0100.00348.71
8.2.50.0100.00448.71
8.2.40.0080.00449.28
8.2.30.0060.00649.31
8.2.20.0090.00348.71
8.2.10.0060.00649.31
8.2.00.0100.00149.28
8.1.310.0060.00316.76
8.1.300.0170.00318.50
8.1.290.0070.00330.84
8.1.280.0100.00725.92
8.1.270.0050.00323.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.14
8.1.230.0060.00617.60
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0100.00548.40
8.1.190.0090.00348.28
8.1.180.0070.00548.71
8.1.170.0130.00248.95
8.1.160.0080.00649.15
8.1.150.0090.00449.17
8.1.140.0090.00449.07
8.1.130.0060.00748.38
8.1.120.0090.00448.39
8.1.110.0070.00648.37
8.1.100.0070.00548.40
8.1.90.0050.00748.40
8.1.80.0090.00348.40
8.1.70.0090.00348.34
8.1.60.0080.00548.48
8.1.50.0070.00548.44
8.1.40.0040.00848.43
8.1.30.0110.00248.46
8.1.20.0110.00248.50
8.1.10.0100.00448.41
8.1.00.0090.00448.37
8.0.300.0000.00718.77
8.0.290.0130.00047.98
8.0.280.0100.00348.90
8.0.270.0100.00248.04
8.0.260.0060.00648.08
8.0.250.0040.00848.12
8.0.240.0050.00748.08
8.0.230.0070.00548.10
8.0.220.0030.00948.14
8.0.210.0060.00548.06
8.0.200.0070.00548.17
8.0.190.0050.00848.17
8.0.180.0110.00248.16
8.0.170.0070.00648.12
8.0.160.0060.00648.13
8.0.150.0090.00448.03
8.0.140.0110.00148.08
8.0.130.0100.00246.31
8.0.120.0130.00048.08
8.0.110.0080.00448.11
8.0.100.0060.00648.10
8.0.90.0050.00748.02
8.0.80.0110.00637.70
8.0.70.0080.00448.06
8.0.60.0050.00648.14
8.0.50.0070.00548.17
8.0.30.0120.00448.21
8.0.20.0100.00837.76
8.0.10.0090.00448.19
8.0.00.0130.00448.03
7.4.330.0060.00447.44
7.4.320.0060.00548.02
7.4.300.0100.00147.98
7.4.290.0060.00647.91
7.4.280.0100.00247.95
7.4.270.0100.00147.98
7.4.260.0070.00446.33
7.4.250.0040.00747.90
7.4.240.0040.00747.99
7.4.230.0100.00247.99
7.4.220.0060.00437.52
7.4.210.0070.01029.13
7.4.200.0060.00547.99
7.4.190.0070.00779.33
7.4.180.0150.00079.33
7.4.160.0090.00579.33
7.4.150.0110.00479.33
7.4.140.0140.00079.33
7.4.130.0100.00837.38
7.4.120.0070.01347.97
7.4.110.0080.00947.96
7.4.100.0090.00647.98
7.4.90.0080.00847.85
7.4.80.0110.00647.81
7.4.70.0090.00847.83
7.4.60.0120.00547.67
7.4.50.0140.00647.66
7.4.40.0090.01047.98
7.4.30.0140.00547.74
7.4.20.0140.00347.79
7.4.10.0080.00847.86
7.4.00.0110.00847.92
7.3.330.0060.00547.78
7.3.320.0030.00846.26
7.3.310.0050.00647.80
7.3.300.0080.00447.79
7.3.290.0060.00647.85
7.3.280.0080.00847.81
7.3.270.0090.00479.33
7.3.260.0090.00847.89
7.3.250.0050.01079.33
7.3.240.0070.00779.33
7.3.230.0050.01047.82
7.3.220.0110.00579.33
7.3.210.0070.00947.85
7.3.200.0150.00447.78
7.3.190.0140.00547.74
7.3.180.0110.00647.93
7.3.170.0100.00847.78
7.3.160.0110.00747.80
7.3.150.0090.00847.87
7.3.140.0130.00547.89
7.3.130.0100.00747.77
7.3.120.0070.01047.76
7.3.110.0120.00447.98
7.3.100.0140.00347.73
7.3.90.0140.00247.77
7.3.80.0050.01147.97
7.3.70.0120.00747.76
7.3.60.0080.01247.80
7.3.50.0140.00547.74
7.3.40.0120.00647.79
7.3.30.0150.00547.80
7.3.20.0100.01047.86
7.3.10.0080.00947.71
7.3.00.0130.00847.87
7.2.340.0080.00879.33
7.2.330.0130.00447.96
7.2.320.0050.01347.77
7.2.310.0120.00747.90
7.2.300.0070.01247.82
7.2.290.0120.00847.81
7.2.280.0110.00747.80
7.2.270.0080.00947.79
7.2.260.0080.00847.88
7.2.250.0090.00947.98
7.2.240.0090.00947.86
7.2.230.0050.01347.82
7.2.220.0070.01047.83
7.2.210.0040.01247.73
7.2.200.0100.00847.90
7.2.190.0160.00547.79
7.2.180.0130.00647.84
7.2.170.0090.01147.96
7.2.160.0100.01147.96
7.2.150.0140.00447.87
7.2.140.0060.01247.99
7.2.130.0130.00648.02
7.2.120.0120.00547.96
7.2.110.0150.00447.88
7.2.100.0120.00847.86
7.2.90.0260.00748.01
7.2.80.0130.00347.94
7.2.70.0090.00848.00
7.2.60.0080.00948.00
7.2.50.0050.01247.95
7.2.40.0150.00347.94
7.2.30.0090.00847.92
7.2.20.0140.00747.97
7.2.10.0180.00347.92
7.2.00.0150.00647.96

preferences:
27.91 ms | 403 KiB | 5 Q