3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ms = microtime(true); $array = array(); if (count($array) != 0) { foreach($array as $strings) { echo $strings . ' '; } } echo 'Time taken: ' . (microtime(true) - $ms) . ' ms<br>'."\n"; $ms = microtime(true); $array = array(); foreach($array as $strings) { echo $strings . ' '; } echo 'Time taken: ' . (microtime(true) - $ms) . ' ms<br>'."\n"; $ms = microtime(true); $array = array('String', 'Not String'); if (count($array) != 0) { foreach($array as $strings) { echo $strings. ' '; } } echo 'Time taken: ' . (microtime(true) - $ms) . ' ms<br>'."\n"; $ms = microtime(true); $array = array('String', 'Not String'); foreach($array as $strings) { echo $strings .' '; } echo 'Time taken: ' . (microtime(true) - $ms) . ' ms<br>'."\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.0040.01414.90
7.3.120.0070.00914.95
7.3.110.0040.01414.78
7.3.100.0050.01014.80
7.3.90.0050.00714.89
7.3.80.0060.00814.78
7.3.70.0080.00614.76
7.3.60.0060.00914.70
7.3.50.0060.00914.79
7.3.40.0050.00714.81
7.3.30.0060.00914.92
7.3.20.0060.00716.47
7.3.10.0080.00716.76
7.3.00.0080.00416.66
7.2.250.0050.01114.97
7.2.240.0110.00815.17
7.2.230.0060.00815.01
7.2.220.0070.00715.12
7.2.210.0050.00815.24
7.2.200.0080.00715.02
7.2.190.0060.00915.16
7.2.180.0030.01215.12
7.2.170.0030.01314.99
7.2.160.0030.01314.73
7.2.150.0090.00917.07
7.2.140.0030.01216.71
7.2.130.0070.00616.92
7.2.120.0120.00216.88
7.2.110.0010.01316.97
7.2.100.0090.00616.75
7.2.90.0050.00816.95
7.2.80.0020.00916.98
7.2.70.0100.00716.93
7.2.60.0050.01216.86
7.2.50.0060.01017.05
7.2.40.0040.01116.95
7.2.30.0090.00516.94
7.2.20.0050.00916.94
7.2.10.0080.00917.02
7.2.00.0040.00817.81
7.1.330.0060.00915.70
7.1.320.0060.01015.76
7.1.310.0080.00515.80
7.1.300.0090.00415.72
7.1.290.0090.00615.73
7.1.280.0050.00715.81
7.1.270.0040.01015.77
7.1.260.0040.01215.71
7.1.250.0110.00315.66
7.1.70.0000.00916.97
7.1.60.0060.00616.97
7.1.50.0040.01817.05
7.1.00.0030.07322.45
7.0.200.0080.00816.86
7.0.140.0000.07721.96
7.0.120.0100.06322.12
7.0.60.0130.08020.05
7.0.50.0030.09017.80
7.0.40.0070.09020.04
7.0.30.0270.04320.02
7.0.20.0230.05020.20
7.0.10.0270.08320.12
7.0.00.0000.05720.09
5.6.280.0000.07721.07
5.6.210.0100.06020.57
5.6.200.0100.03318.11
5.6.190.0200.05020.43
5.6.180.0270.08020.59
5.6.170.0230.03720.45
5.6.160.0070.04020.61
5.6.150.0230.05318.20
5.6.140.0100.05718.18
5.6.130.0130.05318.11
5.6.120.0000.04321.13
5.6.110.0030.09020.97
5.6.100.0030.08020.95
5.6.90.0100.08321.02
5.6.80.0100.05720.41
5.6.70.0270.07320.42
5.5.350.0230.08720.32
5.5.340.0030.08717.95
5.5.330.0130.08020.21
5.5.320.0170.08720.47
5.5.310.0200.04020.32
5.5.300.0070.08018.01
5.5.290.0200.04317.95
5.5.280.0030.08320.80
5.5.270.0070.06720.79
5.5.260.0100.08020.87
5.5.250.0070.08320.59
5.5.240.0100.03020.15
5.4.450.0100.03319.12
5.4.440.0070.03719.44
5.4.430.0130.02719.32
5.4.420.0070.03719.23
5.4.410.0000.04019.34
5.4.400.0070.03319.01
5.4.390.0070.03319.17
5.4.380.0070.03319.18
5.4.370.0030.03718.80
5.4.360.0030.04019.11
5.4.350.0100.03018.91
5.4.340.0030.03719.07
5.4.320.0030.06319.10
5.4.310.0000.05719.11
5.4.300.0030.08018.80
5.4.290.0070.03718.92
5.4.280.0100.06019.08
5.4.270.0000.04318.85
5.4.260.0130.06719.17
5.4.250.0070.08019.14
5.4.240.0030.04719.08
5.4.230.0030.04019.14
5.4.220.0100.06718.78
5.4.210.0170.07019.07
5.4.200.0130.07019.07
5.4.190.0170.05718.90
5.4.180.0130.05318.78
5.4.170.0030.06019.10
5.4.160.0100.07319.05
5.4.150.0070.07719.12
5.4.140.0070.07016.48
5.4.130.0130.06716.24
5.4.120.0000.04316.25
5.4.110.0100.07316.36
5.4.100.0030.07716.34
5.4.90.0030.07316.33
5.4.80.0030.07016.22
5.4.70.0030.04316.27
5.4.60.0030.04316.28
5.4.50.0070.04716.38
5.4.40.0100.07316.13
5.4.30.0100.07016.63
5.4.20.0100.07016.21
5.4.10.0170.06316.25
5.4.00.0030.06315.79
5.3.290.0070.08014.60
5.3.280.0070.06714.53
5.3.270.0070.03714.54
5.3.260.0100.04714.50
5.3.250.0000.08014.50
5.3.240.0100.07314.55
5.3.230.0100.04714.56
5.3.220.0030.04714.51
5.3.210.0030.06314.54
5.3.200.0100.06314.50
5.3.190.0070.08014.40
5.3.180.0030.07014.52
5.3.170.0030.07714.50
5.3.160.0130.03014.51
5.3.150.0030.03714.52
5.3.140.0100.07014.54
5.3.130.0130.07714.65
5.3.120.0030.08314.49
5.3.110.0070.04014.44
5.3.100.0100.04313.98
5.3.90.0000.04013.95
5.3.80.0070.07013.97
5.3.70.0070.06713.82
5.3.60.0030.06713.83
5.3.50.0130.06713.93
5.3.40.0130.07313.90
5.3.30.0100.07313.73
5.3.20.0070.05013.51
5.3.10.0100.05713.59
5.3.00.0100.06313.57
5.2.170.0000.04011.00
5.2.160.0030.03311.09
5.2.150.0000.07011.06
5.2.140.0030.03711.05
5.2.130.0000.03311.05
5.2.120.0000.03311.00
5.2.110.0030.03711.12
5.2.100.0100.05311.20
5.2.90.0030.06011.27
5.2.80.0070.06011.01
5.2.70.0030.06011.09
5.2.60.0070.06011.00
5.2.50.0070.05011.00
5.2.40.0130.05711.00
5.2.30.0070.06011.00
5.2.20.0030.06311.00
5.2.10.0070.03011.00
5.2.00.0030.06011.00
5.1.60.0070.02711.00
5.1.50.0100.04711.00
5.1.40.0030.05711.00
5.1.30.0030.05311.00
5.1.20.0070.05711.00
5.1.10.0100.03711.00
5.1.00.0030.05311.00
5.0.50.0100.02011.00
5.0.40.0030.04011.00
5.0.30.0000.03311.00
5.0.20.0000.04311.00
5.0.10.0030.03011.00
5.0.00.0000.03711.00
4.4.90.0030.03011.00
4.4.80.0030.02311.00
4.4.70.0030.03011.00
4.4.60.0030.03311.00
4.4.50.0070.03311.00
4.4.40.0030.04711.00
4.4.30.0030.01711.00
4.4.20.0100.02711.00
4.4.10.0030.02011.00
4.4.00.0000.05711.00
4.3.110.0030.03711.00
4.3.100.0000.02711.00
4.3.90.0000.02711.00
4.3.80.0000.06011.00
4.3.70.0000.03711.00
4.3.60.0030.03711.00
4.3.50.0000.03011.00
4.3.40.0000.05011.00
4.3.30.0000.02311.00
4.3.20.0000.02311.00
4.3.10.0000.01711.00
4.3.00.0000.02011.00

preferences:
38.56 ms | 401 KiB | 5 Q