3v4l.org

run code in 300+ PHP versions simultaneously
<?php function agefilter($item) { return ($item['age'] == 21); } $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, 'agefilter'); $time = microtime(true) - $time; echo 'callback 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.0100.02022.84
7.4.00.0150.01522.55
7.3.130.0110.02122.41
7.3.120.0090.01922.66
7.3.110.0100.01922.73
7.3.100.0140.00922.66
7.3.90.0120.01522.60
7.3.80.0120.01522.63
7.3.70.0130.01622.57
7.3.60.0080.01422.71
7.3.50.0030.01822.76
7.3.40.0080.01022.54
7.3.30.0060.01522.49
7.3.20.0100.01024.72
7.3.10.0080.01024.75
7.3.00.0030.01724.57
7.2.260.0070.01722.86
7.2.250.0230.00822.77
7.2.240.0070.02222.76
7.2.230.0110.01622.94
7.2.220.0090.01723.01
7.2.210.0070.01922.82
7.2.200.0100.01622.98
7.2.190.0120.01122.88
7.2.180.0100.01323.00
7.2.170.0070.01822.74
7.2.160.0080.01422.80
7.2.150.0030.01625.18
7.2.140.0100.01225.12
7.2.130.0020.01825.15
7.2.120.0070.01225.17
7.2.110.0050.01725.16
7.2.100.0060.01525.10
7.2.90.0040.01525.00
7.2.80.0050.01725.14
7.2.70.0120.00925.16
7.2.60.0040.01825.17
7.2.50.0050.01525.15
7.2.40.0140.00724.95
7.2.30.0120.01124.98
7.2.20.0080.01024.93
7.2.10.0030.01825.20
7.2.00.0060.01225.94
7.1.330.0070.02023.92
7.1.320.0070.02124.04
7.1.310.0100.01623.97
7.1.300.0060.01624.03
7.1.290.0010.01723.85
7.1.280.0050.01323.92
7.1.270.0050.01723.91
7.1.260.0030.01723.92
7.1.250.0050.01724.00
7.1.240.0030.01524.00
7.1.230.0070.01323.96
7.1.220.0050.01724.12
7.1.210.0080.01323.88
7.1.200.0070.01724.10
7.1.190.0090.01523.93
7.1.180.0070.01523.84
7.1.170.0080.01324.02
7.1.160.0090.01324.01
7.1.150.0050.02123.97
7.1.140.0020.02023.91
7.1.130.0030.01924.12
7.1.120.0080.01224.15
7.1.110.0020.01923.97
7.1.100.0060.01623.81
7.1.90.0080.01524.13
7.1.80.0090.01524.08
7.1.70.0080.01724.41
7.1.60.0060.01524.61
7.1.50.0060.01924.35
7.1.40.0090.01323.99
7.1.30.0060.01624.04
7.1.20.0050.01423.98
7.1.10.0050.01924.08
7.1.00.0030.04026.12
7.0.330.0060.01423.79
7.0.320.0080.01423.63
7.0.310.0060.01423.84
7.0.300.0070.01423.70
7.0.290.0000.02023.84
7.0.280.0080.01423.65
7.0.270.0090.00923.56
7.0.260.0080.01123.60
7.0.250.0100.01123.72
7.0.240.0020.01923.73
7.0.230.0050.01423.73
7.0.220.0050.01823.50
7.0.210.0050.01823.77
7.0.200.0040.01524.27
7.0.190.0020.01823.61
7.0.180.0050.01823.70
7.0.170.0040.01623.67
7.0.160.0020.01623.66
7.0.150.0030.02223.58
7.0.140.0090.03525.95
7.0.130.0060.01223.67
7.0.120.0020.01923.68
7.0.110.0070.01823.71
7.0.100.0050.01123.77
7.0.90.0090.01323.74
7.0.80.0050.01423.75
7.0.70.0050.01923.76
7.0.60.0060.03225.13
7.0.50.0070.02524.60
7.0.40.0100.03715.92
7.0.30.0110.02816.00
7.0.20.0120.02715.79
7.0.10.0040.03916.04
7.0.00.0070.03015.90
5.6.400.0080.03928.45
5.6.390.0180.03128.85
5.6.380.0120.03628.50
5.6.370.0120.03628.51
5.6.360.0100.03528.55
5.6.350.0210.03128.77
5.6.340.0140.03128.46
5.6.330.0080.04028.74
5.6.320.0070.03828.63
5.6.310.0080.04328.20
5.6.300.0070.04828.82
5.6.290.0120.03728.70
5.6.280.0080.05930.95
5.6.270.0130.03428.58
5.6.260.0100.04028.70
5.6.250.0110.03828.74
5.6.240.0050.04428.57
5.6.230.0120.03528.83
5.6.220.0100.03928.60
5.6.210.0110.05830.69
5.6.200.0100.05429.84
5.6.190.0110.05830.61
5.6.180.0170.04530.68
5.6.170.0190.06030.57
5.6.160.0100.05630.46
5.6.150.0130.05729.85
5.6.140.0100.06429.87
5.6.130.0140.06029.95
5.6.120.0100.05230.77
5.6.110.0120.05530.63
5.6.100.0120.04230.66
5.6.90.0210.05330.80
5.6.80.0090.05530.56
5.6.70.0160.03128.69
5.6.60.0120.04028.46
5.6.50.0170.03828.35
5.6.40.0150.03828.58
5.6.30.0160.04528.34
5.6.20.0130.03628.58
5.6.10.0100.03328.53
5.6.00.0110.04028.70
5.5.380.0100.03528.68
5.5.370.0120.03728.53
5.5.360.0110.03328.45
5.5.350.0180.06330.47
5.5.340.0110.04529.68
5.5.330.0080.05330.56
5.5.320.0140.04830.43
5.5.310.0190.05830.44
5.5.300.0130.03829.73
5.5.290.0140.06029.61
5.5.280.0090.04830.71
5.5.270.0120.05930.79
5.5.260.0110.06130.70
5.5.250.0100.05530.61
5.5.240.1380.04330.58
5.5.230.0130.04528.56
5.5.220.0100.04528.56
5.5.210.0100.03528.43
5.5.200.0200.03528.43
5.5.190.0130.04728.46
5.5.180.0110.03928.74
5.5.170.0120.03628.51
5.5.160.0070.04228.62
5.5.150.0150.03928.45
5.5.140.0130.04828.36
5.5.130.0070.04728.56
5.5.120.0130.03728.35
5.5.110.0130.03528.46
5.5.100.0130.03528.68
5.5.90.0120.03528.45
5.5.80.0130.03928.33
5.5.70.0110.04028.53
5.5.60.0080.04828.56
5.5.50.0110.03628.26
5.5.40.0080.03828.63
5.5.30.0100.05428.42
5.5.20.0150.03728.38
5.5.10.0210.04128.67
5.5.00.0070.05428.23
5.4.450.0140.05228.10
5.4.440.0200.04728.18
5.4.430.0130.05327.93
5.4.420.0170.05728.09
5.4.410.0160.05627.89
5.4.400.0140.05027.91
5.4.390.0160.04427.90
5.4.380.0120.06128.06
5.4.370.0140.05727.97
5.4.360.0140.04927.93
5.4.350.0140.04627.99
5.4.340.0140.04227.79
5.4.330.0080.03625.28
5.4.320.0130.05727.90
5.4.310.0190.05127.88
5.4.300.0150.05727.90
5.4.290.0200.06127.84
5.4.280.0140.05627.85
5.4.270.0190.05627.98
5.4.260.0190.05827.89
5.4.250.0170.05728.00
5.4.240.0160.04128.02
5.4.230.0110.04927.78
5.4.220.0180.05427.84
5.4.210.0140.04727.86
5.4.200.0170.05928.05
5.4.190.0150.04927.81
5.4.180.0280.05327.96
5.4.170.0140.06427.89
5.4.160.0190.04528.12
5.4.150.0210.04227.89
5.4.140.0130.04027.14
5.4.130.0160.03927.14
5.4.120.0140.04326.96
5.4.110.0150.04027.10
5.4.100.0160.04227.06
5.4.90.0150.04127.06
5.4.80.0110.04527.01
5.4.70.0150.04427.01
5.4.60.0210.03727.03
5.4.50.0200.04227.04
5.4.40.0080.05227.06
5.4.30.0200.03827.09
5.4.20.0120.04327.06
5.4.10.0140.03827.11
5.4.00.0120.04026.87
5.3.290.0200.09030.30
5.3.280.0300.09030.36
5.3.270.0200.10730.14
5.3.260.0400.06030.16
5.3.250.0300.08030.21
5.3.240.0170.06330.16
5.3.230.0270.05730.05
5.3.220.0230.06330.12
5.3.210.0200.07030.04
5.3.200.0070.08730.11
5.3.190.0270.05730.21
5.3.180.0170.05730.11
5.3.170.0130.06030.05
5.3.160.0230.05330.10
5.3.150.0200.05330.09
5.3.140.0330.05730.20
5.3.130.0130.06030.11
5.3.120.0230.05030.04
5.3.110.0270.05030.03
5.3.100.0170.06029.60
5.3.90.0300.04729.57
5.3.80.0170.05729.55
5.3.70.0230.05329.48
5.3.60.0230.05029.41
5.3.50.0230.06029.43
5.3.40.0130.06029.34
5.3.30.0170.06029.61
5.3.20.0170.05729.17
5.3.10.0100.06329.05
5.3.00.0230.07329.13
5.2.170.0130.04725.96
5.2.160.0130.04725.88
5.2.150.0170.04725.73
5.2.140.0170.04725.80
5.2.130.0130.04725.76
5.2.120.0170.05025.66
5.2.110.0200.05325.77
5.2.100.0230.08025.65
5.2.90.0270.08325.77
5.2.80.0270.07725.74
5.2.70.0230.08025.77
5.2.60.0170.05025.87
5.2.50.0200.06325.55
5.2.40.0170.05325.34
5.2.30.0270.06025.31
5.2.20.0100.07725.40
5.2.10.0230.08325.45
5.2.00.0170.08725.30
5.1.60.0270.07329.39
5.1.50.0370.08329.47
5.1.40.0270.07729.37
5.1.30.0200.06729.66
5.1.20.0170.08029.78
5.1.10.0200.05329.35
5.1.00.0230.05729.54
5.0.50.0070.05327.86
5.0.40.0070.05027.79
5.0.30.0170.10027.56
5.0.20.0170.08327.59
5.0.10.0170.07327.61
5.0.00.0130.06327.55
4.4.90.0230.03725.27
4.4.80.0030.06025.31
4.4.70.0100.04725.35
4.4.60.0100.05725.36
4.4.50.0170.08025.24
4.4.40.0130.07325.23
4.4.30.0130.08725.24
4.4.20.0230.06325.29
4.4.10.0100.04725.28
4.4.00.0230.06725.29
4.3.110.0200.08725.13
4.3.100.0130.06325.23
4.3.90.0100.04725.11
4.3.80.0200.07325.14
4.3.70.0330.04725.16
4.3.60.0170.08325.16
4.3.50.0100.07725.16
4.3.40.0230.10325.14
4.3.30.0070.08323.93
4.3.20.0170.05023.96
4.3.10.0130.07323.86
4.3.00.0270.06723.92

preferences:
62.58 ms | 401 KiB | 5 Q