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>'."\n"; $ms = microtime(); $array = array(); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'."\n"; $ms = microtime(); $array = array('String', 'Not String'); if (count($array) != 0) { foreach($array as $strings) { echo $strings; } } echo 'Time taken: ' . (microtime() - $ms) . ' ms<br>'."\n"; $ms = microtime(); $array = array('String', 'Not String'); foreach($array as $strings) { echo $strings; } echo 'Time taken: ' . (microtime() - $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.3.120.0040.01514.88
7.3.110.0000.01515.00
7.3.100.0100.00714.88
7.3.90.0100.00715.15
7.3.80.0030.01315.02
7.3.70.0100.00714.74
7.3.60.0120.00314.63
7.3.50.0070.00414.70
7.3.40.0070.00714.92
7.3.30.0040.00814.88
7.3.20.0030.01316.76
7.3.10.0120.00316.79
7.3.00.0030.01016.69
7.2.240.0080.00815.00
7.2.230.0060.00914.88
7.2.220.0080.00314.95
7.2.210.0060.00915.27
7.2.200.0000.01415.14
7.2.190.0100.00714.91
7.2.180.0000.01415.12
7.2.170.0040.01214.88
7.2.160.0130.00314.89
7.2.150.0070.01016.80
7.2.140.0080.00816.97
7.2.130.0070.00416.94
7.2.120.0030.01016.68
7.2.110.0130.00316.59
7.2.100.0030.01017.04
7.2.90.0070.00416.82
7.2.80.0000.01117.06
7.2.70.0110.00716.79
7.2.60.0080.00816.98
7.2.50.0000.01417.03
7.2.40.0000.01316.86
7.2.30.0000.00917.02
7.2.20.0120.00317.14
7.2.10.0100.00717.04
7.2.00.0060.00618.07
7.1.330.0000.01715.77
7.1.320.0040.01115.65
7.1.310.0000.01015.96
7.1.300.0040.00415.82
7.1.290.0100.00315.57
7.1.280.0040.01115.73
7.1.270.0040.00815.72
7.1.260.0060.01015.86
7.1.250.0030.01415.70
7.1.70.0000.00717.07
7.1.60.0130.01019.33
7.1.50.0130.00717.01
7.1.00.0030.07722.53
7.0.200.0070.00716.84
7.0.140.0000.07722.08
7.0.60.0170.07720.04
7.0.50.0030.07017.88
7.0.40.0030.04320.19
7.0.30.0300.07320.13
7.0.20.0270.05720.21
7.0.10.0100.06719.99
7.0.00.0130.04020.13
5.6.280.0100.06321.12
5.6.210.0070.08020.47
5.6.200.0000.04318.12
5.6.190.0030.05020.60
5.6.180.0200.03720.49
5.6.170.0200.04320.47
5.6.160.0070.05320.62
5.6.150.0030.08018.07
5.6.140.0030.08318.12
5.6.130.0100.07318.17
5.6.120.0130.05721.02
5.6.110.0070.04321.05
5.6.100.0100.07320.98
5.6.90.0070.05720.88
5.6.80.0200.06720.52
5.6.70.4000.03020.37
5.5.350.0000.04320.41
5.5.340.0030.07717.93
5.5.330.0030.07020.58
5.5.320.0200.04020.56
5.5.310.0270.07020.31
5.5.300.0100.06718.02
5.5.290.0070.08317.95
5.5.280.0100.07020.69
5.5.270.0030.08720.96
5.5.260.0070.08020.64
5.5.250.0130.06020.50
5.5.240.0130.04320.37
5.4.450.0270.06019.43
5.4.440.1170.06019.29
5.4.430.0970.04719.32
5.4.420.1170.07319.47
5.4.410.0900.06719.30
5.4.400.0100.06718.78
5.4.390.0370.06319.22
5.4.380.0400.04718.75
5.4.370.0100.06718.49
5.4.360.0370.06018.71
5.4.350.0230.05018.71
5.4.340.0330.05718.67
5.4.320.0040.04112.46
5.4.310.0070.04212.46
5.4.300.0070.03912.46
5.4.290.0050.04212.46
5.4.280.0050.04212.36
5.4.270.0070.03412.36
5.4.260.0070.03912.36
5.4.250.0060.04912.36
5.4.240.0040.03712.36
5.4.230.0050.04012.35
5.4.220.0060.05112.35
5.4.210.0060.03612.35
5.4.200.0020.04012.35
5.4.190.0160.04312.36
5.4.180.0140.04412.36
5.4.170.0180.04012.37
5.4.160.0180.04112.36
5.4.150.0150.04412.35
5.4.140.0120.04512.04
5.4.130.0130.04512.03
5.4.120.0140.04311.98
5.4.110.0150.04211.98
5.4.100.0160.04211.98
5.4.90.0110.04711.98
5.4.80.0140.04311.98
5.4.70.0130.04411.98
5.4.60.0160.04111.97
5.4.50.0170.04011.98
5.4.40.0280.09011.96
5.4.30.0170.04011.96
5.4.20.0100.04611.96
5.4.10.0150.04111.96
5.4.00.0140.04311.45
5.3.290.0070.04812.80
5.3.280.0100.03712.71
5.3.270.0150.04512.72
5.3.260.0110.04912.71
5.3.250.0150.04612.72
5.3.240.0180.04212.72
5.3.230.0190.04212.71
5.3.220.0220.06812.68
5.3.210.0170.04412.68
5.3.200.0160.04312.68
5.3.190.0130.04812.68
5.3.180.0180.04212.68
5.3.170.0280.09212.67
5.3.160.0190.04112.67
5.3.150.0090.05012.68
5.3.140.0160.04512.66
5.3.130.0170.04512.65
5.3.120.0160.04412.66
5.3.110.0210.03912.66
5.3.100.0210.03912.12
5.3.90.0180.07012.09
5.3.80.0140.04612.07
5.3.70.0180.04212.08
5.3.60.0150.04512.06
5.3.50.0130.04612.01
5.3.40.0160.04312.01
5.3.30.0390.08111.98
5.3.20.0150.05011.75
5.3.10.0170.04211.72
5.3.00.0150.04111.70
5.2.170.0140.0369.21
5.2.160.0070.0419.20
5.2.150.0190.0329.20
5.2.140.0180.0319.20
5.2.130.0140.0349.16
5.2.120.0130.0349.16
5.2.110.0350.0769.16
5.2.100.0130.0369.16
5.2.90.0160.0329.16
5.2.80.0200.0369.15
5.2.70.0170.0419.15
5.2.60.0110.0369.11
5.2.50.0150.0339.08
5.2.40.0200.0359.06
5.2.30.0130.0369.03
5.2.20.0110.0409.02
5.2.10.0150.0358.97
5.2.00.0120.0368.83
5.1.60.0150.0268.13
5.1.50.0110.0298.12
5.1.40.0080.0328.11
5.1.30.0140.0318.45
5.1.20.0170.0278.48
5.1.10.0120.0318.20
5.1.00.0150.0278.20
5.0.50.0100.0256.68
5.0.40.0100.0226.53
5.0.30.0100.0376.35
5.0.20.0100.0246.32
5.0.10.0100.0216.30
5.0.00.0080.0366.29
4.4.90.0110.0144.77
4.4.80.0070.0184.76
4.4.70.0070.0194.75
4.4.60.0070.0194.75
4.4.50.0050.0214.77
4.4.40.0070.0294.71
4.4.30.0060.0204.75
4.4.20.0100.0154.85
4.4.10.0040.0214.85
4.4.00.0040.0314.75
4.3.110.0100.0154.67
4.3.100.0100.0144.66
4.3.90.0070.0174.63
4.3.80.0080.0274.59
4.3.70.0070.0184.63
4.3.60.0070.0174.62
4.3.50.0090.0154.63
4.3.40.0110.0234.54
4.3.30.0040.0193.34
4.3.20.0060.0173.34
4.3.10.0060.0173.29
4.3.00.0070.01015.61

preferences:
35.89 ms | 400 KiB | 5 Q