3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 20000; $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.00.0070.02422.60
7.3.120.0130.01922.54
7.3.110.0110.01822.52
7.3.100.0210.01022.82
7.3.90.0110.01122.63
7.3.80.0030.02422.50
7.3.70.0070.01122.69
7.3.60.0070.01422.57
7.3.50.0150.00622.40
7.3.40.0180.00722.45
7.3.30.0100.01022.40
7.3.20.0060.00924.81
7.3.10.0160.01324.43
7.3.00.0100.01224.27
7.2.250.0160.01622.99
7.2.240.0090.02223.07
7.2.230.0030.01923.03
7.2.220.0100.01622.61
7.2.210.0090.02223.08
7.2.200.0040.01923.02
7.2.190.0110.01122.88
7.2.180.0170.01022.67
7.2.170.0070.01422.76
7.2.160.0070.01622.96
7.2.150.0070.00724.93
7.2.140.0100.01925.36
7.2.130.0190.01224.78
7.2.120.0190.01124.90
7.2.110.0140.01324.85
7.2.100.0170.01024.64
7.2.90.0170.01324.95
7.2.80.0200.01225.14
7.2.70.0200.01225.08
7.2.60.0220.01125.10
7.2.50.0180.01525.07
7.2.40.0200.01224.93
7.2.30.0220.01325.04
7.2.20.0250.01125.02
7.2.10.0190.01125.17
7.2.00.0140.01525.78
7.1.330.0160.01323.90
7.1.320.0090.01224.07
7.1.310.0000.02723.69
7.1.300.0060.01523.99
7.1.290.0070.01023.66
7.1.280.0070.01323.98
7.1.270.0000.02024.20
7.1.260.0070.02024.06
7.1.250.0130.02223.96
7.1.240.0000.02423.69
7.1.230.0150.00923.89
7.1.220.0000.02624.16
7.1.210.0060.01823.79
7.1.200.0030.01723.98
7.1.190.0030.01724.17
7.1.180.0100.01023.81
7.1.170.0030.01323.77
7.1.160.0100.01324.12
7.1.150.0060.01324.16
7.1.140.0100.01024.22
7.1.130.0100.01024.04
7.1.120.0100.01024.10
7.1.110.0060.01624.09
7.1.100.0030.01224.08
7.1.90.0060.01924.05
7.1.80.0100.01323.98
7.1.70.0150.01424.53
7.1.60.0070.01524.64
7.1.50.0080.01424.71
7.1.40.0100.01323.91
7.1.30.0030.01323.82
7.1.20.0060.01023.74
7.1.10.0030.02024.01
7.1.00.0080.04327.07
7.0.330.0040.01523.73
7.0.320.0040.01623.52
7.0.310.0040.01423.70
7.0.300.0030.01523.79
7.0.290.0130.01623.68
7.0.280.0000.01823.54
7.0.270.0030.01623.45
7.0.260.0100.01323.82
7.0.250.0040.01423.39
7.0.240.0030.01423.89
7.0.230.0030.01623.86
7.0.220.0060.01223.75
7.0.210.0070.01523.70
7.0.200.0080.01424.25
7.0.190.0030.01623.78
7.0.180.0100.01323.82
7.0.170.0070.02323.79
7.0.160.0100.01023.69
7.0.150.0130.01023.84
7.0.140.0050.04826.87
7.0.130.0030.02023.86
7.0.120.0100.01323.54
7.0.110.0030.02523.83
7.0.100.0000.02023.77
7.0.90.0100.01423.71
7.0.80.0100.02023.60
7.0.70.0100.01323.57
7.0.60.0070.05225.63
7.0.50.0070.05424.81
7.0.40.0020.05416.91
7.0.30.0080.03617.11
7.0.20.0200.04817.06
7.0.10.0120.05317.11
7.0.00.0030.03616.89
5.6.400.0200.04128.29
5.6.390.0160.02928.87
5.6.380.0260.02328.74
5.6.370.0070.03428.63
5.6.360.0160.03228.77
5.6.350.0170.03728.69
5.6.340.0160.02928.63
5.6.330.0200.02728.51
5.6.320.0070.04128.59
5.6.310.0070.03328.76
5.6.300.0200.02728.77
5.6.290.0130.02928.86
5.6.280.0140.06431.92
5.6.270.0170.03728.93
5.6.260.0100.03628.66
5.6.250.0040.03928.64
5.6.240.0130.03128.61
5.6.230.0070.06028.55
5.6.220.0100.05628.65
5.6.210.0110.06931.70
5.6.200.0080.06730.43
5.6.190.0050.06731.68
5.6.180.0200.04731.56
5.6.170.0250.07231.50
5.6.160.0220.05731.44
5.6.150.0100.07330.33
5.6.140.0090.04730.41
5.6.130.0100.07030.44
5.6.120.0130.05731.94
5.6.110.0160.06831.76
5.6.100.0120.07632.08
5.6.90.0120.05031.98
5.6.80.0180.05431.74
5.6.70.0130.03328.54
5.6.60.0100.04028.56
5.6.50.0140.03428.39
5.6.40.0130.03328.63
5.6.30.0220.02528.48
5.6.20.0100.03928.63
5.6.10.0140.03128.45
5.6.00.0130.03228.21
5.5.380.0070.05028.80
5.5.370.0190.03528.78
5.5.360.0100.03728.50
5.5.350.0110.05631.65
5.5.340.0150.05530.27
5.5.330.0150.06031.36
5.5.320.1670.04931.47
5.5.310.0200.05431.21
5.5.300.0150.06830.26
5.5.290.0100.05730.54
5.5.280.0130.04331.53
5.5.270.0080.06431.80
5.5.260.0070.08631.60
5.5.250.0130.05331.65
5.5.240.1830.04931.54
5.5.230.0100.03528.43
5.5.220.0160.03228.34
5.5.210.0030.04728.45
5.5.200.0070.03828.46
5.5.190.0070.03728.33
5.5.180.0070.04028.79
5.5.170.0000.04428.61
5.5.160.0030.04228.54
5.5.150.0130.03328.77
5.5.140.0100.03728.70
5.5.130.0000.04428.73
5.5.120.0170.03028.40
5.5.110.0200.03628.30
5.5.100.0100.03928.50
5.5.90.0070.03928.45
5.5.80.0030.04228.64
5.5.70.0160.03328.72
5.5.60.0200.04128.56
5.5.50.0030.04228.53
5.5.40.0030.04528.63
5.5.30.0140.03528.27
5.5.20.0100.03828.66
5.5.10.0070.04128.35
5.5.00.0170.04028.33
5.4.450.0220.05529.43
5.4.440.0120.07529.33
5.4.430.0180.04829.35
5.4.420.0300.05529.41
5.4.410.0170.06629.54
5.4.400.0200.06029.34
5.4.390.0200.06829.40
5.4.380.0220.04329.18
5.4.370.0130.06929.38
5.4.360.0220.05329.36
5.4.350.0170.04929.29
5.4.340.0200.05629.22
5.4.330.0060.04525.24
5.4.320.0200.06329.42
5.4.310.0200.04829.21
5.4.300.0100.05129.26
5.4.290.0210.06129.23
5.4.280.0220.04629.23
5.4.270.0170.04829.35
5.4.260.0200.04029.33
5.4.250.0150.04229.05
5.4.240.0150.04728.99
5.4.230.0190.04229.06
5.4.220.0180.04329.14
5.4.210.0150.04429.06
5.4.200.0130.05029.26
5.4.190.0200.03829.32
5.4.180.0170.04329.22
5.4.170.0150.04329.13
5.4.160.0200.04829.13
5.4.150.0130.04629.16
5.4.140.0180.04827.85
5.4.130.0180.03628.05
5.4.120.0160.04627.94
5.4.110.0180.05027.80
5.4.100.0120.04828.01
5.4.90.0170.04227.84
5.4.80.0130.04827.94
5.4.70.0200.06227.93
5.4.60.0080.05228.02
5.4.50.0240.05127.93
5.4.40.0180.06627.90
5.4.30.0230.05827.91
5.4.20.0150.06327.87
5.4.10.0130.04927.90
5.4.00.0190.05927.56
5.3.290.0200.10730.35
5.3.280.0170.05730.23
5.3.270.0170.06030.16
5.3.260.0200.05330.21
5.3.250.0270.06330.20
5.3.240.0200.05330.08
5.3.230.0230.06330.05
5.3.220.0230.05330.05
5.3.210.0200.05730.05
5.3.200.0230.05030.12
5.3.190.0170.06030.03
5.3.180.0100.06730.03
5.3.170.0300.06330.20
5.3.160.0270.09030.02
5.3.150.0300.06030.03
5.3.140.0200.10030.12
5.3.130.0230.05330.31
5.3.120.0200.05730.11
5.3.110.0300.09030.18
5.3.100.0230.06329.49
5.3.90.0200.10029.61
5.3.80.0330.09029.58
5.3.70.0170.08729.44
5.3.60.0100.07029.51
5.3.50.0200.09029.52
5.3.40.0270.08729.37
5.3.30.0230.07329.32
5.3.20.0300.09329.27
5.3.10.0430.08329.28
5.3.00.0370.06029.13
5.2.170.0000.04012.72
5.2.160.0170.02712.72
5.2.150.0200.04012.72
5.2.140.0170.03712.72
5.2.130.0130.04012.72
5.2.120.0230.05712.72
5.2.110.0270.02312.72
5.2.100.0200.05712.72
5.2.90.0170.06012.72
5.2.80.0200.05012.72
5.2.70.0200.06012.72
5.2.60.0300.02712.72
5.2.50.0230.05712.72
5.2.40.0200.02312.72
5.2.30.0270.03012.72
5.2.20.0170.05712.72
5.2.10.0230.05012.72
5.2.00.0130.05012.72
5.1.60.0170.05712.72
5.1.50.0130.03312.72
5.1.40.0170.05012.72
5.1.30.0230.04712.72
5.1.20.0230.05312.72
5.1.10.0200.04712.72
5.1.00.0130.03312.72
5.0.50.0100.02312.72
5.0.40.0070.04712.72
5.0.30.0100.04312.72
5.0.20.0070.04012.72
5.0.10.0100.03012.72
5.0.00.0070.03012.72
4.4.90.0130.01712.72
4.4.80.0070.02012.72
4.4.70.0070.04012.72
4.4.60.0070.04012.72
4.4.50.0070.02712.72
4.4.40.0100.05012.72
4.4.30.0070.03012.72
4.4.20.0130.03312.72
4.4.10.0170.02312.72
4.4.00.0100.02712.72
4.3.110.0070.02712.72
4.3.100.0030.02012.72
4.3.90.0070.02312.72
4.3.80.0100.05312.72
4.3.70.0070.02712.72
4.3.60.0130.01312.72
4.3.50.0070.03712.72
4.3.40.0070.04012.72
4.3.30.0030.02012.72
4.3.20.0100.03312.72
4.3.10.0130.02012.72
4.3.00.0030.03712.72

preferences:
34.62 ms | 400 KiB | 5 Q