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.10.0090.00615.04
7.4.00.0030.01315.13
7.3.130.0130.00615.11
7.3.120.0000.01614.75
7.3.110.0080.01014.77
7.3.100.0050.00815.04
7.3.90.0090.00614.75
7.3.80.0050.00914.93
7.3.70.0100.00314.94
7.3.60.0050.00714.86
7.3.50.0060.00614.81
7.3.40.0020.01214.76
7.3.30.0040.00814.67
7.3.20.0090.00616.65
7.3.10.0110.00616.44
7.3.00.0050.01116.47
7.2.260.0040.01515.28
7.2.250.0020.01615.13
7.2.240.0040.01215.22
7.2.230.0070.00715.15
7.2.220.0100.00515.01
7.2.210.0040.01015.05
7.2.200.0050.00615.15
7.2.190.0080.00614.99
7.2.180.0040.00815.09
7.2.170.0030.01015.13
7.2.160.0010.01215.09
7.2.150.0030.01217.04
7.2.140.0050.00816.84
7.2.130.0070.01016.81
7.2.120.0100.00716.78
7.2.110.0070.00716.62
7.2.100.0120.00716.94
7.2.90.0080.01016.70
7.2.80.0070.00716.67
7.2.70.0060.00816.87
7.2.60.0110.00716.96
7.2.50.0080.00916.75
7.2.40.0020.01216.68
7.2.30.0090.00616.74
7.2.20.0090.00616.79
7.2.10.0090.00516.88
7.2.00.0080.00717.24
7.1.330.0020.01215.83
7.1.320.0060.00615.92
7.1.310.0050.01015.83
7.1.300.0070.00515.80
7.1.290.0040.00615.69
7.1.280.0020.00915.73
7.1.270.0050.00915.85
7.1.260.0050.01115.69
7.1.250.0060.01115.75
7.1.240.0000.01215.83
7.1.230.0100.00315.91
7.1.220.0030.01015.73
7.1.210.0040.01415.84
7.1.200.0130.00316.01
7.1.190.0090.00615.77
7.1.180.0030.01415.78
7.1.170.0130.00315.90
7.1.160.0100.00315.86
7.1.150.0120.00815.80
7.1.140.0000.01416.02
7.1.130.0000.01415.64
7.1.120.0000.00815.88
7.1.110.0070.00415.66
7.1.100.0060.00615.81
7.1.90.0080.00415.82
7.1.80.0030.01015.52
7.1.70.0030.00516.51
7.1.60.0080.00416.61
7.1.50.0050.01016.45
7.1.40.0030.00715.98
7.1.30.0070.00715.86
7.1.20.0060.00615.71
7.1.10.0040.01115.82
7.1.00.0020.04319.16
7.0.330.0110.00415.44
7.0.320.0060.00615.22
7.0.310.0060.00915.19
7.0.300.0030.01315.50
7.0.290.0030.01015.45
7.0.280.0110.00015.48
7.0.270.0100.00015.28
7.0.260.0000.00815.27
7.0.250.0080.00815.41
7.0.240.0000.01115.59
7.0.230.0040.01115.59
7.0.220.0040.00815.52
7.0.210.0030.00915.66
7.0.200.0040.01116.09
7.0.190.0090.00615.56
7.0.180.0050.01215.38
7.0.170.0070.00715.56
7.0.160.0130.00015.30
7.0.150.0130.00315.40
7.0.140.0070.03718.78
7.0.130.0110.00315.52
7.0.120.0040.00815.54
7.0.110.0070.04317.70
7.0.100.0050.04617.67
7.0.90.0030.04217.56
7.0.80.0070.04017.55
7.0.70.0100.03917.67
7.0.60.0080.03917.67
7.0.50.0170.03017.73
7.0.40.0100.04116.56
7.0.30.0070.04216.72
7.0.20.0050.04316.68
7.0.10.0030.03016.71
7.0.00.0090.04416.61
5.6.400.0040.01214.34
5.6.390.0030.00714.02
5.6.380.0000.01014.51
5.6.370.0030.01014.20
5.6.360.0040.01114.34
5.6.350.0080.00414.24
5.6.340.0000.01314.25
5.6.330.0030.01414.53
5.6.320.0070.01014.29
5.6.310.0100.00614.24
5.6.300.0060.00814.34
5.6.290.0030.00714.37
5.6.280.0050.04217.77
5.6.270.0090.00614.37
5.6.260.0060.04517.34
5.6.250.0080.04117.56
5.6.240.0100.03817.62
5.6.230.0100.04017.47
5.6.220.0030.04817.55
5.6.210.0090.03217.49
5.6.200.0070.04717.37
5.6.190.0090.02417.45
5.6.180.0090.03617.44
5.6.170.0050.02417.62
5.6.160.0090.03817.46
5.6.150.0070.02517.35
5.6.140.0050.04417.52
5.6.130.0100.02017.42
5.6.120.0050.04417.47
5.6.110.0050.03517.39
5.6.100.0100.04017.44
5.6.90.0120.03017.42
5.6.80.0050.04517.28
5.6.70.0110.01817.21
5.6.60.0090.03517.10
5.6.50.0000.04617.04
5.6.40.0120.03117.04
5.6.30.0040.03717.16
5.6.20.0070.04217.31
5.6.10.0050.04717.11
5.6.00.0090.03317.14
5.5.380.0070.04215.96
5.5.370.0000.04515.92
5.5.360.0030.04415.90
5.5.350.0060.04615.91
5.5.340.0050.04516.10
5.5.330.0020.05016.23
5.5.320.0060.02016.27
5.5.310.0100.01816.15
5.5.300.0060.03816.16
5.5.290.0090.03616.36
5.5.280.0070.04316.14
5.5.270.0050.04716.05
5.5.260.0030.02315.97
5.5.250.0080.03815.76
5.5.240.0050.03515.82
5.5.230.0030.04215.95
5.5.220.0050.04515.77
5.5.210.0050.04115.92
5.5.200.0050.03515.94
5.5.190.0030.04415.76
5.5.180.0040.03315.82
5.5.170.0030.00614.28
5.5.160.0060.03815.83
5.5.150.0070.04415.61
5.5.140.0050.02615.76
5.5.130.0070.04215.96
5.5.120.0030.04515.72
5.5.110.0030.04415.61
5.5.100.0080.04315.88
5.5.90.0070.04215.85
5.5.80.0030.03815.71
5.5.70.0100.03815.69
5.5.60.0050.04315.56
5.5.50.0050.04215.92
5.5.40.0070.04215.94
5.5.30.0060.01915.74
5.5.20.0050.04515.81
5.5.10.0030.03815.52
5.5.00.0070.02215.61
5.4.450.0040.04116.06
5.4.440.0030.03915.99
5.4.430.0050.03715.98
5.4.420.0060.02816.03
5.4.410.0100.02215.88
5.4.400.0080.03915.79
5.4.390.0020.04015.79
5.4.380.0070.02515.81
5.4.370.0070.03815.82
5.4.360.0080.04015.79
5.4.350.0050.02015.94
5.4.340.0070.02715.90
5.4.330.0060.00612.63
5.4.320.0050.03915.81
5.4.310.0070.04115.78
5.4.300.0110.03515.85
5.4.290.0070.04215.94
5.4.280.0050.04015.82
5.4.270.0080.04015.89
5.4.260.0060.04315.90
5.4.250.0020.03515.86
5.4.240.0080.03815.82
5.4.230.0070.03715.93
5.4.220.0050.04315.80
5.4.210.0090.03715.81
5.4.200.0080.03515.78
5.4.190.0080.03515.87
5.4.180.0060.04015.81
5.4.170.0050.04115.81
5.4.160.0080.02015.87
5.4.150.0050.04215.80
5.4.140.0060.01814.58
5.4.130.0030.02014.54
5.4.120.0030.04114.40
5.4.110.0150.02814.57
5.4.100.0070.03814.56
5.4.90.0070.03514.56
5.4.80.0110.03214.55
5.4.70.0030.03514.50
5.4.60.0020.04214.55
5.4.50.0070.03314.48
5.4.40.0030.04114.53
5.4.30.0020.04314.54
5.4.20.0080.03614.49
5.4.10.0090.02714.51
5.4.00.0050.04214.22
5.3.290.0080.02213.55
5.3.280.0030.04013.59
5.3.270.0110.03013.65
5.3.260.0020.04613.66
5.3.250.0080.03013.56
5.3.240.0040.04313.58
5.3.230.0080.03313.62
5.3.220.0030.03813.52
5.3.210.0080.03613.54
5.3.200.0050.04113.52
5.3.190.0060.03613.50
5.3.180.0050.03813.63
5.3.170.0070.03713.51
5.3.160.0000.04513.54
5.3.150.0070.02213.56
5.3.140.0050.03913.55
5.3.130.0050.02413.64
5.3.120.0040.04313.56
5.3.110.0030.04813.64
5.3.100.0030.04513.23
5.3.90.0020.02213.34
5.3.80.0030.03813.37
5.3.70.0090.03513.38
5.3.60.0020.04013.29
5.3.50.0020.04513.23
5.3.40.0050.02513.22
5.3.30.0050.03813.21
5.3.20.0040.03813.14
5.3.10.0030.04113.11
5.3.00.0030.02313.07
5.2.170.0030.05311.78
5.2.160.0070.05711.78
5.2.150.0030.06311.78
5.2.140.0070.03311.78
5.2.130.0030.03711.78
5.2.120.0000.04711.78
5.2.110.0030.06311.78
5.2.100.0030.06011.78
5.2.90.0030.06711.78
5.2.80.0070.03311.78
5.2.70.0030.06311.78
5.2.60.0030.05711.78
5.2.50.0070.06011.78
5.2.40.0000.06311.78
5.2.30.0130.05711.78
5.2.20.0030.06311.78
5.2.10.0000.05011.78
5.2.00.0030.06011.78
5.1.60.0130.04711.78
5.1.50.0000.05311.78
5.1.40.0070.02711.78
5.1.30.0000.05711.78
5.1.20.0070.04711.78
5.1.10.0070.05711.78
5.1.00.0070.05311.78
5.0.50.0030.03011.78
5.0.40.0030.02011.78
5.0.30.0030.03311.78
5.0.20.0070.04011.78
5.0.10.0000.03711.78
5.0.00.0000.06011.78
4.4.90.0000.03311.78
4.4.80.0030.03311.78
4.4.70.0000.04011.78
4.4.60.0030.03311.78
4.4.50.0030.03311.78
4.4.40.0000.05311.78
4.4.30.0070.03011.78
4.4.20.0030.03711.78
4.4.10.0000.02011.78
4.4.00.0000.03711.78
4.3.110.0030.02011.78
4.3.100.0000.01711.78
4.3.90.0030.03711.78
4.3.80.0000.02711.78
4.3.70.0000.02711.78
4.3.60.0030.03311.78
4.3.50.0000.02311.78
4.3.40.0030.02711.78
4.3.30.0000.02011.78
4.3.20.0000.02711.78
4.3.10.0070.02711.78
4.3.00.0000.02311.78

preferences:
63.94 ms | 401 KiB | 5 Q