3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ms = microtime(); $array = array(); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'; $ms = microtime(); $array = array(); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'; $ms = microtime(); $array = array('String', 'Not String'); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'; $ms = microtime(); $array = array('String', 'Not String'); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>';

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.2.00.0030.01019.27
7.1.70.0100.00017.22
7.1.60.0110.01419.32
7.1.50.0030.01016.89
7.1.00.0070.07322.28
7.0.200.1080.01414.82
7.0.140.0070.07022.00
7.0.60.0100.07020.06
7.0.50.0000.05317.66
7.0.40.0100.08320.24
7.0.30.0200.06320.09
7.0.20.0230.04020.04
7.0.10.0030.04320.13
7.0.00.0130.06320.20
5.6.280.0100.06721.15
5.6.210.0100.05320.47
5.6.200.0070.08018.10
5.6.190.0030.04720.61
5.6.180.0170.06320.41
5.6.170.0430.06720.49
5.6.160.0070.08320.49
5.6.150.0130.06318.20
5.6.140.0070.07018.18
5.6.130.0030.07318.11
5.6.120.0100.03321.01
5.6.110.0100.03321.00
5.6.100.0170.06721.14
5.6.90.0030.04320.88
5.6.80.0000.05020.51
5.5.350.0170.07020.34
5.5.340.0070.03717.98
5.5.330.0000.05020.36
5.5.320.0100.08720.50
5.5.310.0270.06320.13
5.5.300.0030.06317.87
5.5.290.0100.04717.88
5.5.280.0100.08020.77
5.5.270.0100.06320.64
5.5.260.0000.05320.87
5.5.250.0100.05320.70
5.5.240.0000.06720.16
5.4.450.1130.05019.46
5.4.440.1900.05019.41
5.4.430.1830.03319.45
5.4.420.1830.02719.46
5.4.410.2130.04719.37
5.4.400.1870.03719.16
5.4.390.2170.04319.13
5.4.380.1800.03319.10
5.4.370.1900.04018.78
5.4.360.1730.03319.24
5.4.350.2130.05019.25
5.4.340.1730.03319.25
5.4.320.1930.04318.88
5.4.310.1770.04018.92
5.4.300.1630.03719.21
5.4.290.1770.04318.91
5.4.280.1970.04019.06
5.4.270.1900.04318.91
5.4.260.1930.04319.21
5.4.250.1870.04319.12
5.4.240.1930.04719.08
5.4.230.1570.03019.09
5.4.220.1570.03718.89
5.4.210.1870.04018.92
5.4.200.1600.03719.15
5.4.190.1770.04319.25
5.4.180.1600.04018.88
5.4.170.1700.03018.77
5.4.160.1830.04319.20
5.4.150.1770.05019.08
5.4.140.1600.03716.28
5.4.130.1970.04016.43
5.4.120.1570.04016.26
5.4.110.1770.04316.34
5.4.100.1830.04716.39
5.4.90.1700.02716.24
5.4.80.1800.03716.48
5.4.70.1600.03716.39
5.4.60.1930.04316.19
5.4.50.1630.03316.43
5.4.40.1930.03716.19
5.4.30.1630.03716.39
5.4.20.1900.04316.13
5.4.10.1830.03316.36
5.4.00.1900.03715.97
5.3.290.1970.04314.79
5.3.280.2070.04314.45
5.3.270.1830.05014.45
5.3.260.2130.03314.45
5.3.250.1700.04014.71
5.3.240.1700.03714.66
5.3.230.2400.03014.57
5.3.220.1630.04014.56
5.3.210.1730.03714.53
5.3.200.1670.03314.61
5.3.190.1800.03714.59
5.3.180.1970.05014.52
5.3.170.1700.03014.40
5.3.160.1800.03014.43
5.3.150.1830.03014.52
5.3.140.1830.03714.47
5.3.130.1900.04014.41
5.3.120.1830.03314.39
5.3.110.1770.04014.51
5.3.100.1800.03013.88
5.3.90.1900.04014.12
5.3.80.1930.03313.88
5.3.70.2130.04013.90
5.3.60.1670.03713.95
5.3.50.1970.03713.80
5.3.40.1970.04313.73
5.3.30.1930.04313.94
5.3.20.1770.03713.55
5.3.10.1930.03713.52
5.3.00.1670.03713.71
5.2.170.1500.03711.07
5.2.160.1570.04011.32
5.2.150.1370.03011.24
5.2.140.1600.04011.09
5.2.130.1530.03010.97
5.2.120.1530.03311.29
5.2.110.1630.03710.97
5.2.100.1370.03010.93
5.2.90.1630.03311.00
5.2.80.1700.02710.95
5.2.70.1600.03310.96
5.2.60.1630.04011.22
5.2.50.1630.04011.18
5.2.40.1500.02711.05
5.2.30.1270.03310.82
5.2.20.1370.02710.91
5.2.10.1300.03010.98
5.2.00.1330.03710.79
5.1.60.1330.03010.08
5.1.50.1400.0239.96
5.1.40.1170.0309.95
5.1.30.1070.02310.39
5.1.20.1270.03310.33
5.1.10.1330.02710.16
5.1.00.1070.02710.06
5.0.50.0600.0208.68
5.0.40.0700.0338.50
5.0.30.0670.0308.36
5.0.20.0670.0278.19
5.0.10.0700.0308.13
5.0.00.0500.0338.25
4.4.90.0500.0178.13
4.4.80.0600.0178.13
4.4.70.0700.0278.13
4.4.60.0700.0308.13
4.4.50.0670.0278.13
4.4.40.0700.0308.13
4.4.30.0730.0238.13
4.4.20.0630.0238.13
4.4.10.0700.0238.13
4.4.00.0700.0378.13
4.3.110.0670.0178.13
4.3.100.0770.0208.13
4.3.90.0570.0138.13
4.3.80.0530.0278.13
4.3.70.0530.0178.13
4.3.60.0530.0178.13
4.3.50.0570.0138.13
4.3.40.0700.0408.13
4.3.30.0330.0308.13
4.3.20.0330.0338.13
4.3.10.0270.0208.13
4.3.00.0300.0178.13

preferences:
42.28 ms | 400 KiB | 5 Q