3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filter($array, callable $c) { $result = []; foreach ($array as $key => $value) { if ($c($value, $key)) { $result[$key] = $value; } } return $result; } var_dump(filter(['foo', '', 'bar'], function ($value) { return strlen($value); })); // Internal functions already throw on superfluous args var_dump(filter(['foo', '', 'bar'], 'strlen'));

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.30.0130.00719.35
8.5.20.0110.00620.21
8.5.10.0130.00816.91
8.5.00.0140.00719.90
8.4.180.0160.00525.86
8.4.170.0150.00624.04
8.4.160.0100.01223.98
8.4.150.0030.00014.05
8.4.140.0110.01017.45
8.4.130.0090.01117.95
8.4.120.0140.00620.77
8.4.110.0110.00918.80
8.4.100.0050.00418.57
8.4.90.0060.00318.59
8.4.80.0110.00918.82
8.4.70.0120.00817.95
8.4.60.0150.00618.79
8.4.50.0160.00418.94
8.4.40.0100.00718.72
8.4.30.0100.01018.93
8.4.20.0100.01019.75
8.4.10.0100.00019.58
8.3.300.0130.00720.14
8.3.290.0150.00520.84
8.3.280.0130.00620.73
8.3.270.0100.01016.63
8.3.260.0110.00916.55
8.3.250.0100.00918.79
8.3.240.0090.01016.66
8.3.230.0100.00616.72
8.3.220.0050.00318.95
8.3.210.0120.00716.64
8.3.200.0050.00416.79
8.3.190.0110.01017.09
8.3.180.0110.00717.19
8.3.170.0120.00618.61
8.3.160.0180.00017.27
8.3.150.0100.01017.14
8.3.140.0090.00020.73
8.3.130.0080.00018.30
8.3.120.0030.00619.02
8.3.110.0040.00420.94
8.3.100.0090.00024.06
8.3.90.0040.00426.77
8.3.80.0030.00616.88
8.3.70.0110.00716.58
8.3.60.0080.01116.61
8.3.50.0070.01418.29
8.3.40.0160.00621.60
8.3.30.0180.00420.80
8.3.20.0120.00321.84
8.3.10.0000.01521.85
8.3.00.0190.00318.89
8.2.300.0110.00918.70
8.2.290.0130.00620.69
8.2.280.0110.00518.63
8.2.270.0040.00417.21
8.2.260.0090.00916.57
8.2.250.0000.00816.61
8.2.240.0000.00818.74
8.2.230.0000.00922.58
8.2.220.0060.00937.54
8.2.210.0130.00726.77
8.2.200.0060.00318.41
8.2.190.0140.00316.58
8.2.180.0120.00318.19
8.2.170.0130.00319.26
8.2.160.0130.01020.00
8.2.150.0130.00919.18
8.2.140.0100.01020.38
8.2.130.0100.00720.43
8.2.120.0070.01419.27
8.2.110.0120.00619.43
8.2.100.0140.00719.25
8.2.90.0150.00718.91
8.2.80.0110.00719.46
8.2.70.0040.01818.63
8.2.60.0140.00418.96
8.2.50.0150.00319.45
8.2.40.0070.01118.96
8.2.30.0090.00919.01
8.2.20.0190.00018.78
8.2.10.0120.00618.96
8.2.00.0110.00818.91
8.1.340.0090.01021.69
8.1.330.0090.00921.90
8.1.320.0110.00816.32
8.1.310.0000.00818.74
8.1.300.0040.00420.13
8.1.290.0030.00630.84
8.1.280.0070.01025.92
8.1.270.0100.00722.02
8.1.260.0150.00422.07
8.1.250.0090.00922.09
8.1.240.0130.00618.44
8.1.230.0140.00718.74
8.1.220.0110.00718.87
8.1.210.0090.00918.46
8.1.200.0200.00018.60
8.1.190.0120.00818.67
8.1.180.0100.00618.32
8.1.170.0140.00420.60
8.1.160.0080.00818.53
8.1.150.0060.00918.47
8.1.140.0080.00818.75
8.1.130.0030.01420.52
8.1.120.0090.00618.32
8.1.110.0140.00418.55
8.1.100.0150.00019.86
8.1.90.0150.00018.36
8.1.80.0030.01219.50
8.1.70.0000.01418.80
8.1.60.0170.00318.76
8.1.50.0140.00718.54
8.1.40.0060.00918.55
8.1.30.0180.00318.85
8.1.20.0080.00819.91
8.1.10.0120.00918.79
8.1.00.0080.00818.53

preferences:
33.65 ms | 403 KiB | 5 Q