3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 200000; $i++) { $a[] = array( 'name' => 'John', 'city' => 'New York', 'age' => $i % 200 == 0 ? 21 : 28 ); } $time = microtime(true); $filtered = array_filter($a, function ($item) { return ($item['age'] == 21); }); $time = microtime(true) - $time; echo 'closure took ' . number_format($time, 3) . ' seconds and returned ' . count($filtered) . " entries\n";

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)
7.4.10.0370.03072.56
7.4.00.0460.03372.66
7.3.130.0360.04672.46
7.3.120.0410.03772.52
7.3.110.0470.04072.19
7.3.100.0270.03772.71
7.3.90.0400.04072.48
7.3.80.0200.03672.66
7.3.70.0270.03472.59
7.3.60.0350.02272.55
7.3.50.0300.04072.61
7.3.40.0300.03072.61
7.3.30.0340.03072.63
7.3.20.0170.02774.61
7.3.10.0170.02374.51
7.3.00.0070.03774.66
7.2.260.0330.04372.94
7.2.250.0270.04072.59
7.2.240.0260.03372.50
7.2.230.0380.03572.93
7.2.220.0370.05072.89
7.2.210.0230.03772.65
7.2.200.0370.02372.93
7.2.190.0430.03772.59
7.2.180.0270.03472.64
7.2.170.0270.04172.88
7.2.160.0330.02972.84
7.2.150.0200.02674.89
7.2.140.0130.02674.82
7.2.130.0160.02574.74
7.2.120.0130.04074.72
7.2.110.0160.03374.64
7.2.100.0070.04274.60
7.2.90.0290.02674.90
7.2.80.0280.01474.77
7.2.70.0330.03374.92
7.2.60.0230.03074.43
7.2.50.0100.03474.87
7.2.40.3270.03074.85
7.2.30.0100.03874.66
7.2.20.0160.02074.84
7.2.10.0070.02674.55
7.2.00.0330.02676.10
7.1.330.0100.04473.77
7.1.320.0030.05373.71
7.1.310.0160.03973.53
7.1.300.0200.05373.78
7.1.290.0160.04373.90
7.1.280.0130.04373.71
7.1.270.0190.04973.80
7.1.260.0190.04873.45
7.1.250.0210.04573.84
7.1.240.0260.04273.74
7.1.230.0270.03773.87
7.1.220.0200.04073.61
7.1.210.0160.04173.50
7.1.200.0200.04073.76
7.1.190.0170.04073.93
7.1.180.0200.03773.43
7.1.170.0270.03473.53
7.1.160.0470.05073.67
7.1.150.0100.05473.73
7.1.140.0070.04673.67
7.1.130.0030.04873.91
7.1.120.0100.04673.37
7.1.110.0160.03573.75
7.1.100.0220.05573.57
7.1.90.0430.04673.84
7.1.80.0350.04273.88
7.1.70.0750.03374.52
7.1.60.0410.04874.51
7.1.50.0100.05474.29
7.1.40.0420.03973.55
7.1.30.0270.04773.53
7.1.20.0300.05573.80
7.1.10.0210.05773.88
7.1.00.0180.07477.09
7.0.330.0160.05973.58
7.0.320.0330.03373.61
7.0.310.0130.04673.54
7.0.300.0230.04273.44
7.0.290.0160.03973.43
7.0.280.0110.05373.39
7.0.270.0100.04573.26
7.0.260.0100.04973.46
7.0.250.0200.04473.59
7.0.240.0880.05173.59
7.0.230.0390.05373.51
7.0.220.1410.03173.61
7.0.210.0120.05873.51
7.0.200.0890.03674.15
7.0.190.0390.04173.46
7.0.180.0370.04673.23
7.0.170.0250.04873.49
7.0.160.0380.04173.50
7.0.150.0160.05973.46
7.0.140.0200.07176.69
7.0.130.0360.04573.33
7.0.120.0220.05173.48
7.0.110.1850.04375.61
7.0.100.0400.09675.78
7.0.90.0660.08975.64
7.0.80.0570.08175.62
7.0.70.0690.07675.48
7.0.60.0450.08875.60
7.0.50.0370.09075.67
7.0.40.0370.08525.49
7.0.30.0260.08225.52
7.0.20.0280.07725.55
7.0.10.0230.08925.66
7.0.00.0140.08225.39
5.6.400.0370.11879.01
5.6.390.0330.10979.03
5.6.380.0300.10378.94
5.6.370.0430.10279.23
5.6.360.0370.10578.81
5.6.350.0340.10879.08
5.6.340.0490.08979.31
5.6.330.0170.11278.70
5.6.320.0430.10979.18
5.6.310.0550.08578.86
5.6.300.0500.10778.79
5.6.290.0320.11378.79
5.6.280.0380.12282.13
5.6.270.0470.09478.67
5.6.260.0350.09182.06
5.6.250.0480.08782.09
5.6.240.0250.12582.09
5.6.230.0300.13482.04
5.6.220.0400.11882.10
5.6.210.0390.11881.94
5.6.200.0320.12782.07
5.6.190.0400.11881.89
5.6.180.0370.13682.16
5.6.170.0420.12182.09
5.6.160.0340.12481.91
5.6.150.0310.12381.88
5.6.140.0390.13582.11
5.6.130.0450.10982.08
5.6.120.0500.11882.09
5.6.110.0290.13081.99
5.6.100.0440.13181.94
5.6.90.0450.10681.97
5.6.80.0350.11081.61
5.6.70.0390.10381.68
5.6.60.0450.11081.79
5.6.50.0300.13181.64
5.6.40.0330.08881.69
5.6.30.0210.13381.53
5.6.20.0290.12481.64
5.6.10.0300.11081.67
5.6.00.0460.10681.88
5.5.380.0300.11980.64
5.5.370.0300.11580.45
5.5.360.0570.10680.45
5.5.350.0390.12680.50
5.5.340.0330.11480.71
5.5.330.0300.12880.75
5.5.320.0410.10280.75
5.5.310.0430.12280.63
5.5.300.0370.11880.80
5.5.290.0290.11580.67
5.5.280.0380.08780.66
5.5.270.0480.11680.63
5.5.260.0310.12980.66
5.5.250.0390.12080.55
5.5.240.0410.10680.36
5.5.230.0310.09280.35
5.5.220.0370.09480.51
5.5.210.0360.09480.37
5.5.200.0430.11780.52
5.5.190.0470.10880.14
5.5.180.0330.12780.37
5.5.170.0440.10178.71
5.5.160.0240.10880.34
5.5.150.0360.11580.38
5.5.140.0330.12380.34
5.5.130.0390.09380.38
5.5.120.0430.10080.32
5.5.110.0360.09380.43
5.5.100.0340.10080.24
5.5.90.0250.11680.39
5.5.80.0320.10380.30
5.5.70.0390.10080.14
5.5.60.0300.09180.27
5.5.50.0420.08480.35
5.5.40.0280.09880.33
5.5.30.0350.10180.37
5.5.20.0340.11280.26
5.5.10.0300.10280.21
5.5.00.0340.12380.47
5.4.450.0300.10079.66
5.4.440.0320.11779.62
5.4.430.0280.12379.81
5.4.420.0430.09879.70
5.4.410.0450.10579.79
5.4.400.0310.12379.48
5.4.390.0300.09679.67
5.4.380.0250.11979.51
5.4.370.0270.10079.53
5.4.360.0330.10979.44
5.4.350.0400.08579.40
5.4.340.0250.10479.51
5.4.330.0260.10875.38
5.4.320.0200.10779.61
5.4.310.0280.13079.50
5.4.300.0330.09779.63
5.4.290.0300.12479.60
5.4.280.0280.10279.61
5.4.270.0350.11179.39
5.4.260.0480.08579.80
5.4.250.0430.09379.52
5.4.240.0390.09679.58
5.4.230.0350.09179.56
5.4.220.0210.11979.64
5.4.210.0370.10779.45
5.4.200.0360.08979.64
5.4.190.0360.08979.59
5.4.180.0250.11479.53
5.4.170.0370.08779.47
5.4.160.0290.09879.69
5.4.150.0270.10579.45
5.4.140.0300.12178.30
5.4.130.0290.12178.34
5.4.120.0310.11778.26
5.4.110.0350.08678.17
5.4.100.0340.10378.12
5.4.90.0300.08778.13
5.4.80.0360.09878.26
5.4.70.0460.11378.18
5.4.60.0410.09478.26
5.4.50.0260.10478.30
5.4.40.0280.11478.29
5.4.30.0370.10178.13
5.4.20.0230.10378.38
5.4.10.0320.09078.11
5.4.00.0360.10678.03
5.3.290.0230.09377.68
5.3.280.0230.09377.74
5.3.270.0300.09377.59
5.3.260.0230.12077.58
5.3.250.0370.15077.61
5.3.240.0200.09777.61
5.3.230.0270.15777.60
5.3.220.0130.12077.55
5.3.210.0230.09777.56
5.3.200.0100.10777.63
5.3.190.0230.09377.64
5.3.180.0200.09777.40
5.3.170.0200.09777.80
5.3.160.0200.09377.45
5.3.150.0270.10777.55
5.3.140.0200.09777.56
5.3.130.0230.13377.44
5.3.120.0200.11777.54
5.3.110.0200.09777.62
5.3.100.0270.16377.11
5.3.90.0370.15377.10
5.3.80.0130.13376.96
5.3.70.0270.08777.02
5.3.60.0430.12077.08
5.3.50.0370.11777.11
5.3.40.0200.09776.84
5.3.30.0200.09776.83
5.3.20.0230.09076.70
5.3.10.0170.13377.37
5.3.00.0370.10076.54
5.2.170.0030.02711.15
5.2.160.0000.03011.07
5.2.150.0000.04311.05
5.2.140.0170.05311.04
5.2.130.0070.05711.13
5.2.120.0070.03311.09
5.2.110.0000.04011.01
5.2.100.0030.02710.89
5.2.90.0030.04711.12
5.2.80.0000.07011.00
5.2.70.0000.03011.17
5.2.60.0030.04011.21
5.2.50.0100.04010.96
5.2.40.0000.04311.02
5.2.30.0070.06010.98
5.2.20.0070.02310.75
5.2.10.0100.05311.09
5.2.00.0000.02710.95
5.1.60.0030.0539.96
5.1.50.0000.03710.24
5.1.40.0000.02310.04
5.1.30.0000.02710.32
5.1.20.0030.04710.25
5.1.10.0030.05710.00
5.1.00.0030.03310.05
5.0.50.0100.0309.24
5.0.40.0070.0379.24
5.0.30.0030.0509.24
5.0.20.0000.0209.24
5.0.10.0000.0279.24
5.0.00.0000.0479.24
4.4.90.0030.0239.24
4.4.80.0000.0339.24
4.4.70.0030.0239.24
4.4.60.0030.0339.24
4.4.50.0000.0309.24
4.4.40.0070.0509.24
4.4.30.0000.0209.24
4.4.20.0000.0209.24
4.4.10.0030.0139.24
4.4.00.0030.0209.24
4.3.110.0000.0339.24
4.3.100.0000.0209.24
4.3.90.0070.0109.24
4.3.80.0000.0239.24
4.3.70.0000.0239.24
4.3.60.0000.0209.24
4.3.50.0030.0139.24
4.3.40.0030.0209.24
4.3.30.0000.0279.24
4.3.20.0000.0179.24
4.3.10.0000.0279.24
4.3.00.0000.0309.24

preferences:
38.77 ms | 400 KiB | 5 Q