3v4l.org

run code in 300+ PHP versions simultaneously
<?php $count = 100000; $a = array(); for ($i = 0; $i < $count; $i++) { if ($i % 2) { $a['key_' . $i] = 'ok'; } } $time = microtime(true); $result = 0; for ($i = 0; $i < $count; $i++) { if (isset($a['key_' . $i])) { ++$result; } } $time = microtime(true) - $time; echo number_format($time, 3) . ' seconds and returned ' . $result . "\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.0100.04419.47
7.3.120.0160.03419.39
7.3.110.0070.04019.29
7.3.100.0030.03219.32
7.3.90.0050.04419.20
7.3.80.0040.03319.16
7.3.70.0070.03819.32
7.3.60.0020.04019.31
7.3.50.0080.02819.28
7.3.40.0030.03819.26
7.3.30.0000.04119.31
7.3.20.0060.02920.75
7.3.10.0040.03120.52
7.3.00.0030.03320.45
7.2.250.0070.05019.28
7.2.240.0090.05019.40
7.2.230.0050.03918.95
7.2.220.0100.03619.25
7.2.210.0100.03219.16
7.2.200.0090.02919.22
7.2.190.0050.03119.11
7.2.180.0070.03519.10
7.2.170.0100.02619.25
7.2.130.0070.02520.93
7.2.120.0090.04020.67
7.2.110.0160.02520.92
7.2.100.0150.02420.84
7.2.90.0070.03420.75
7.2.80.0130.03020.90
7.2.70.0030.03120.89
7.2.60.0070.03020.86
7.2.50.0100.03420.90
7.2.40.0070.03320.92
7.2.30.0200.02320.60
7.2.20.0060.02920.88
7.2.10.0100.02720.66
7.2.00.0100.02622.15
7.1.330.0080.03219.90
7.1.320.0030.04219.82
7.1.310.0050.03619.67
7.1.300.0020.04319.81
7.1.290.0070.03919.81
7.1.280.0050.04419.74
7.1.270.0070.03619.62
7.1.260.0020.04019.80
7.1.250.0130.03619.94
7.1.70.0100.01720.49
7.1.60.0130.04321.24
7.1.50.0030.04220.89
7.1.00.0000.10326.19
7.0.200.0060.02620.86
7.0.140.0100.09326.21
7.0.60.0170.09324.34
7.0.50.0170.09322.07
7.0.40.0070.07021.33
7.0.30.0370.09321.48
7.0.20.0300.09321.42
7.0.10.0470.09021.29
7.0.00.0130.05321.30
5.6.280.0130.11728.57
5.6.210.0200.11328.34
5.6.200.0130.12325.79
5.6.190.0100.06728.02
5.6.180.0370.06728.02
5.6.170.0370.11727.86
5.6.160.0000.08028.05
5.6.150.0030.08725.54
5.6.140.0070.12025.73
5.6.130.0070.09725.80
5.6.120.0100.08028.84
5.6.110.0230.11028.61
5.6.100.0030.08728.78
5.6.90.0030.13728.77
5.6.80.0100.11328.12
5.6.70.3400.05328.03
5.5.350.0100.12028.05
5.5.340.0200.09325.48
5.5.330.0030.07727.81
5.5.320.0400.05727.89
5.5.310.0400.09727.85
5.5.300.0170.06725.54
5.5.290.0130.07325.58
5.5.280.0070.06728.50
5.5.270.0070.12028.62
5.5.260.0030.14028.60
5.5.250.0100.12028.42
5.5.240.0100.12028.02
5.4.450.3070.06727.14
5.4.440.2900.07726.93
5.4.430.3930.05726.95
5.4.420.3600.07027.12
5.4.410.3030.07026.80
5.4.400.3570.06726.38
5.4.390.3330.06726.63
5.4.380.4330.06326.40
5.4.370.4400.06726.52
5.4.360.4070.07026.79
5.4.350.3970.07026.63
5.4.340.3800.06026.61
5.4.320.3330.06326.66
5.4.310.3600.08326.38
5.4.300.3630.06326.52
5.4.290.3730.07326.51
5.4.280.3570.07026.85
5.4.270.3370.06726.66
5.4.260.3470.06326.70
5.4.250.3570.07026.36
5.4.240.3000.05726.81
5.4.230.3630.06326.79
5.4.220.3530.08026.65
5.4.210.3570.07326.67
5.4.200.3770.06026.50
5.4.190.3370.08026.63
5.4.180.3630.06326.56
5.4.170.4170.09026.43
5.4.160.3500.07026.60
5.4.150.3000.07326.46
5.4.140.3230.05723.81
5.4.130.3600.06723.89
5.4.120.3970.07723.80
5.4.110.3770.06024.13
5.4.100.3630.06323.77
5.4.90.3770.06023.97
5.4.80.3370.06024.11
5.4.70.3700.07024.11
5.4.60.1270.06324.10
5.4.50.0130.11323.82
5.4.40.3370.06723.89
5.4.30.3730.06024.05
5.4.20.2770.06723.99
5.4.10.3200.09323.90
5.4.00.3430.06323.38
5.3.290.3330.07023.50
5.3.280.3600.09323.35
5.3.270.3730.06323.36
5.3.260.2900.07323.45
5.3.250.3670.06723.42
5.3.240.4600.09323.46
5.3.230.3130.08023.55
5.3.220.3070.07323.43
5.3.210.3570.08323.50
5.3.200.3130.07323.42
5.3.190.3670.06323.54
5.3.180.3270.07723.41
5.3.170.3870.09723.29
5.3.160.0070.12023.31
5.3.150.0100.10023.38
5.3.140.3900.07323.53
5.3.130.3700.06723.31
5.3.120.3400.07023.50
5.3.110.2100.07323.37
5.3.100.3170.09722.84
5.3.90.3170.07022.99
5.3.80.2900.07322.90
5.3.70.3100.07322.75
5.3.60.2900.06722.98
5.3.50.2870.06722.64
5.3.40.3230.06722.75
5.3.30.3100.07022.80
5.3.20.1570.07022.59
5.3.10.0170.10722.56
5.3.00.3470.06322.31
5.2.170.1970.07019.71
5.2.160.2030.06319.58
5.2.150.2930.06719.73
5.2.140.3000.07319.73
5.2.130.0100.11319.70
5.2.120.0030.08019.54
5.2.110.1770.06319.69
5.2.100.2700.06019.70
5.2.90.3070.06719.51
5.2.80.2800.06719.50
5.2.70.2800.06719.57
5.2.60.3030.07019.76
5.2.50.2730.07719.59
5.2.40.2270.07319.53
5.2.30.2670.07319.41
5.2.20.2630.07319.40
5.2.10.3070.06719.36
5.2.00.2630.07719.41
5.1.60.2830.07721.72
5.1.50.2930.07321.72
5.1.40.2600.07721.51
5.1.30.3030.07722.21
5.1.20.3070.07322.08
5.1.10.3100.07321.60
5.1.00.3030.07721.67
5.0.50.1570.10320.02
5.0.40.1600.10320.09
5.0.30.1870.13320.43
5.0.20.1730.09719.87
5.0.10.1800.09719.82
5.0.00.1800.10319.74
4.4.90.1200.10017.53
4.4.80.1130.09317.49
4.4.70.1300.09717.51
4.4.60.1800.09017.56
4.4.50.1530.10017.54
4.4.40.1530.09317.52
4.4.30.1730.09717.63
4.4.20.1800.09317.68
4.4.10.2230.08317.59
4.4.00.1370.10317.57
4.3.110.1570.09017.50
4.3.100.1730.09317.45
4.3.90.1530.09317.56
4.3.80.2130.08317.40
4.3.70.1600.11317.74
4.3.60.1500.09317.50
4.3.50.1570.12317.77
4.3.40.1670.10017.43
4.3.30.0670.09716.18
4.3.20.1000.10316.25
4.3.10.0770.08316.10
4.3.00.0930.10316.21

preferences:
32.88 ms | 401 KiB | 5 Q