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(); foreach ($a as $item) { if ($item['age'] == 21) $filtered[] = $item; } $time = microtime(true) - $time; echo 'explicit foreach ' . 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.3.10.0330.00924.10
7.3.00.0290.01424.37
7.2.130.0260.02024.99
7.2.120.0250.01824.61
7.2.110.0230.01424.92
7.2.100.0210.01524.75
7.2.90.0220.01224.66
7.2.80.0270.01825.04
7.2.70.0290.01324.90
7.2.60.0340.01424.79
7.2.50.0310.01024.54
7.2.40.0220.02424.95
7.2.30.0150.02425.05
7.2.20.0210.02524.85
7.2.10.0210.01924.98
7.2.00.0180.01425.94
7.1.250.0300.01123.85
7.1.70.0000.01225.41
7.1.60.0090.01225.34
7.1.50.0070.01125.30
7.1.00.0000.08330.58
7.0.200.0000.01424.69
7.0.140.0130.07030.29
7.0.60.0130.07327.95
7.0.50.0100.08725.77
7.0.40.0100.05320.01
7.0.30.0370.03320.28
7.0.20.0300.08320.21
7.0.10.0030.05720.12
7.0.00.0070.05020.28
5.6.280.0030.10335.32
5.6.210.0100.06334.92
5.6.200.0070.05732.36
5.6.190.0100.08034.57
5.6.180.0330.05334.58
5.6.170.0370.09334.50
5.6.160.0100.10334.50
5.6.150.0070.06032.25
5.6.140.0300.08032.33
5.6.130.0230.09732.30
5.6.120.0170.11035.16
5.6.110.0100.05335.31
5.6.100.0070.11735.14
5.6.90.0170.10335.13
5.6.80.0170.10034.66
5.6.70.3100.04334.54
5.5.350.0170.06734.56
5.5.340.0100.08032.05
5.5.330.0070.08334.48
5.5.320.0200.06334.33
5.5.310.0430.10034.29
5.5.300.0100.05031.91
5.5.290.0100.08332.11
5.5.280.0100.09034.82
5.5.270.0070.06334.96
5.5.260.0270.10035.06
5.5.250.0230.07734.75
5.5.240.0400.08734.36
5.4.450.0200.08333.73
5.4.440.0500.09733.64
5.4.430.1000.06333.55
5.4.420.0200.08033.57
5.4.410.0130.08333.61
5.4.400.0400.08332.88
5.4.390.0430.08732.69
5.4.380.0470.08332.69
5.4.370.0400.08032.89
5.4.360.0730.10332.75
5.4.350.0210.11626.14
5.4.340.0160.08726.14
5.4.320.0070.05826.63
5.4.310.0100.05626.62
5.4.300.0110.05626.63
5.4.290.0110.06026.62
5.4.280.0100.06126.52
5.4.270.0140.05926.52
5.4.260.0120.05526.52
5.4.250.0090.06426.52
5.4.240.0100.06126.52
5.4.230.0120.06326.51
5.4.220.0080.05626.51
5.4.210.0070.06726.51
5.4.200.0080.05726.52
5.4.190.0070.05626.51
5.4.180.0090.06126.51
5.4.170.0050.06626.52
5.4.160.0140.05226.52
5.4.150.0130.05226.51
5.4.140.0090.05926.20
5.4.130.0110.05526.19
5.4.120.0080.05726.14
5.4.110.0090.06226.14
5.4.100.0100.05626.14
5.4.90.0110.06526.14
5.4.80.0080.06726.14
5.4.70.0100.08226.14
5.4.60.0090.05826.14
5.4.50.0100.05426.13
5.4.40.0150.06026.13
5.4.30.0090.05626.13
5.4.20.0170.06826.12
5.4.10.0140.05026.12
5.4.00.0100.06325.61
5.3.290.0100.06528.39
5.3.280.0110.06928.32
5.3.270.0180.05528.33
5.3.260.0130.05828.33
5.3.250.0130.05528.33
5.3.240.0130.05928.33
5.3.230.0100.06128.32
5.3.220.0130.05728.29
5.3.210.0150.05628.29
5.3.200.0080.07728.29
5.3.190.0170.06128.29
5.3.180.0190.05628.29
5.3.170.0090.06028.29
5.3.160.0140.05328.29
5.3.150.0080.06228.29
5.3.140.0140.05928.28
5.3.130.0100.06128.27
5.3.120.0090.06428.27
5.3.110.0090.06528.27
5.3.100.0120.05927.76
5.3.90.0100.06727.74
5.3.80.0140.05827.73
5.3.70.0110.05827.74
5.3.60.0090.06127.72
5.3.50.0140.05927.67
5.3.40.0100.06227.66
5.3.30.0140.05427.63
5.3.20.0150.05927.41
5.3.10.0140.06727.37
5.3.00.0100.06827.36
5.2.170.0100.05124.07
5.2.160.0060.05224.07
5.2.150.0100.04824.07
5.2.140.0060.05224.07
5.2.130.0040.05224.03
5.2.120.0090.04824.03
5.2.110.0120.05224.03
5.2.100.0100.05824.03
5.2.90.0100.05424.03
5.2.80.0050.05524.02
5.2.70.0080.05224.02
5.2.60.0080.05923.98
5.2.50.0050.06123.95
5.2.40.0130.05323.92
5.2.30.0070.05923.90
5.2.20.0100.05623.89
5.2.10.0100.04623.81
5.2.00.0160.04923.68
5.1.60.0160.04227.48
5.1.50.0070.05127.48
5.1.40.0120.04527.47
5.1.30.0150.06627.82
5.1.20.0120.04927.83
5.1.10.0060.05227.56
5.1.00.0100.05027.56
5.0.50.0080.06126.16
5.0.40.0080.06226.02
5.0.30.0120.06425.71
5.0.20.0060.06025.68
5.0.10.0130.05825.66
5.0.00.0090.06325.66
4.4.90.0110.04824.08
4.4.80.0110.05024.07
4.4.70.0100.06724.06
4.4.60.0060.05424.07
4.4.50.0090.05724.08
4.4.40.0060.06524.08
4.4.30.0110.05524.07
4.4.20.0060.05124.14
4.4.10.0140.06924.14
4.4.00.0080.06624.10
4.3.110.0080.04824.00
4.3.100.0100.05223.99
4.3.90.0110.04523.98
4.3.80.0130.05223.97
4.3.70.0090.04623.97
4.3.60.0070.05023.97
4.3.50.0070.05623.97
4.3.40.0090.06023.93
4.3.30.0120.05122.74
4.3.20.0090.04922.72
4.3.10.0100.05022.66
4.3.00.0170.07023.84

preferences:
44.36 ms | 401 KiB | 5 Q