3v4l.org

run code in 300+ PHP versions simultaneously
<?php // The original function function a($i){$e=microtime(1)+$i;while(microtime(1)<$e);} // Use 'for' instead of 'while' function b($i){for($e=microtime(1)+$i;microtime(1)<$e;);} // Extract 'microtime' into a variable // Requires error_reporting(0) to suppress the "PHP Notice: Use of undefined constant microtime" // Use '-d error_reporting=0' in the command line function c($i){for($f=microtime,$e=$f(1)+$i;$f(1)<$e;);} // Squeeze the initialization of $f into its first use // PHP 7 only; it doesn't compile on older versions function d($i){for($e=($f=microtime)(1)+$i;$f(1)<$e;);}

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.0070.01014.70
7.4.00.0110.00714.67
7.3.130.0070.01014.57
7.3.120.0100.00714.79
7.3.110.0050.01414.50
7.3.100.0050.01314.63
7.3.90.0040.01114.74
7.3.80.0040.01114.59
7.3.70.0020.01214.58
7.3.60.0030.00714.54
7.3.50.0060.00614.54
7.3.40.0050.00614.60
7.3.30.0070.00714.80
7.3.20.0050.00816.56
7.3.10.0040.00916.53
7.3.00.0060.00916.51
7.2.260.0030.01715.05
7.2.250.0070.01314.92
7.2.240.0070.01014.78
7.2.230.0000.01514.88
7.2.220.0070.00514.70
7.2.210.0030.00714.78
7.2.200.0080.00514.69
7.2.190.0030.01014.82
7.2.180.0070.00814.73
7.2.170.0050.01114.79
7.2.160.0020.01014.90
7.2.150.0020.01216.64
7.2.140.0090.00716.57
7.2.130.0070.00616.61
7.2.120.0080.00716.59
7.2.110.0090.00616.64
7.2.100.0040.00916.74
7.2.90.0040.01316.61
7.2.80.0040.00916.67
7.2.70.0060.00516.69
7.2.60.0070.00616.69
7.2.50.0050.00916.78
7.2.40.0060.00516.79
7.2.30.0080.00516.62
7.2.20.0060.00616.71
7.2.10.0030.01116.65
7.2.00.0050.00817.28
7.1.330.0080.00815.70
7.1.320.0040.00615.42
7.1.310.0100.00515.59
7.1.300.0080.00415.55
7.1.290.0020.01115.48
7.1.280.0070.00715.52
7.1.270.0070.00415.58
7.1.260.0080.00715.49
7.1.250.0080.00415.55
7.1.240.0030.00815.54
7.1.230.0000.01015.52
7.1.220.0060.00815.44
7.1.210.0000.01115.67
7.1.200.0090.00315.61
7.1.190.0000.00915.42
7.1.180.0040.00915.41
7.1.170.0030.01015.62
7.1.160.0060.00515.71
7.1.150.0020.00915.51
7.1.140.0090.00715.68
7.1.130.0060.00615.56
7.1.120.0050.00815.61
7.1.110.0050.00915.44
7.1.100.0050.01015.38
7.1.90.0040.00815.53
7.1.80.0070.00515.34
7.1.70.0010.01015.93
7.1.60.0080.00716.77
7.1.50.0060.00715.85
7.1.40.0090.00415.62
7.1.30.0100.00515.61
7.1.20.0030.00715.50
7.1.10.0060.00815.47
7.1.00.0070.02817.77
7.0.330.0050.00615.20
7.0.320.0050.01015.12
7.0.310.0070.00215.41
7.0.300.0030.00715.33
7.0.290.0070.00515.20
7.0.280.0070.00515.17
7.0.270.0050.00815.20
7.0.260.0060.00715.05
7.0.250.0020.01315.18
7.0.240.0020.00815.09
7.0.230.0060.00615.30
7.0.220.0080.00415.24
7.0.210.0050.00715.31
7.0.200.0710.00714.88
7.0.190.0030.01015.19
7.0.180.0080.00315.20
7.0.170.0030.00815.25
7.0.160.0030.00915.27
7.0.150.0030.00815.20
7.0.140.0020.00915.34
7.0.130.0050.00615.20
7.0.120.0030.00915.32
7.0.110.0080.00315.32
7.0.100.0040.03116.81
7.0.90.0030.02116.76
7.0.80.0030.03216.81
7.0.70.0120.02316.90
7.0.60.0070.03016.68
7.0.50.0140.03216.98
7.0.40.0070.02115.57
7.0.30.0060.03215.51
7.0.20.0030.03615.58
7.0.10.0090.02615.65
7.0.00.0100.02915.51
5.6.400.0040.01114.08
5.6.390.0060.01014.04
5.6.380.0090.00414.04
5.6.370.0010.00913.81
5.6.360.0060.00514.14
5.6.350.0030.01014.24
5.6.340.0020.01114.29
5.6.330.0030.01014.21
5.6.320.0020.01114.04
5.6.310.0030.00914.14
5.6.300.0080.00514.04
5.6.290.0050.00714.09
5.6.280.0060.02316.37
5.6.270.0050.00714.21
5.6.260.0060.00814.15
5.6.250.0080.01716.27
5.6.240.0040.02916.20
5.6.230.0060.03116.23
5.6.220.0020.02016.17
5.6.210.0060.03316.25
5.6.200.0050.03016.37
5.6.190.0040.03516.33
5.6.180.0060.01716.42
5.6.170.0030.03716.33
5.6.160.0080.02816.36
5.6.150.0110.03116.31
5.6.140.0070.02016.44
5.6.130.0070.03016.49
5.6.120.0060.02216.46
5.6.110.0090.02616.38
5.6.100.0040.02316.42
5.6.90.0040.03116.44
5.6.80.0110.02616.14
5.6.70.0050.03316.04
5.6.60.0070.02216.15
5.6.50.0050.03516.13
5.6.40.0020.02016.16
5.6.30.0040.03216.16
5.6.20.0100.02716.18
5.6.10.0080.02816.21
5.6.00.0050.03516.14
5.5.380.0070.03216.06
5.5.370.0050.03316.11
5.5.360.0050.03416.10
5.5.350.0050.01915.98
5.5.340.0080.02616.22
5.5.330.0100.02716.24
5.5.320.0010.02216.25
5.5.310.0050.03116.22
5.5.300.0050.02816.25
5.5.290.0050.02316.32
5.5.280.0050.02916.10
5.5.270.0120.01816.28
5.5.260.0080.03416.24
5.5.250.0090.03116.18
5.5.240.0040.02816.13
5.5.230.0060.02516.01
5.5.220.0050.03216.00
5.5.210.0070.02916.01
5.5.200.0070.03116.00
5.5.190.0080.02715.97
5.5.180.0040.03415.89
5.5.170.0060.01114.09
5.5.160.0060.03016.02
5.5.150.0060.02215.91
5.5.140.0070.03215.91
5.5.130.0070.02415.89
5.5.120.0040.03016.01
5.5.110.0040.03416.03
5.5.100.0060.03215.95
5.5.90.0020.02715.92
5.5.80.0040.03315.85
5.5.70.0040.03416.15
5.5.60.0070.03316.07
5.5.50.0070.02516.00
5.5.40.0060.02515.92
5.5.30.0080.02115.94
5.5.20.0080.03016.10
5.5.10.0050.03115.90
5.5.00.0100.03116.11
5.4.450.0060.02513.64
5.4.440.0090.02313.64
5.4.430.0030.02313.64
5.4.420.0090.02213.65
5.4.410.0080.01713.69
5.4.400.0040.02313.36
5.4.390.0050.02713.49
5.4.380.0050.03113.48
5.4.370.0070.02613.47
5.4.360.0070.01513.42
5.4.350.0050.03213.48
5.4.340.0030.02813.44
5.4.330.0030.00610.74
5.4.320.0040.03213.61
5.4.310.0050.03013.55
5.4.300.0070.02713.46
5.4.290.0080.01313.42
5.4.280.0070.01513.51
5.4.270.0060.01813.55
5.4.260.0020.03113.45
5.4.250.0040.02613.49
5.4.240.0040.03213.38
5.4.230.0080.02613.52
5.4.220.0070.02913.52
5.4.210.0030.03313.61
5.4.200.0070.02913.47
5.4.190.0060.01913.40
5.4.180.0040.02913.43
5.4.170.0070.02913.45
5.4.160.0060.02813.56
5.4.150.0040.02313.40
5.4.140.0050.02512.61
5.4.130.0060.01712.54
5.4.120.0020.02912.72
5.4.110.0080.01512.59
5.4.100.0050.02912.75
5.4.90.0030.02912.65
5.4.80.0050.02712.60
5.4.70.0040.02712.59
5.4.60.0050.02612.55
5.4.50.0030.02712.66
5.4.40.0080.02212.66
5.4.30.0040.02112.61
5.4.20.0070.02412.71
5.4.10.0060.02712.76
5.4.00.0070.01912.46
5.3.290.0130.07014.67
5.3.280.0200.06314.66
5.3.270.0100.04714.70
5.3.260.0070.06014.68
5.3.250.0070.03714.59
5.3.240.0030.07014.59
5.3.230.0070.03714.60
5.3.220.0070.04014.57
5.3.210.0130.07714.64
5.3.200.0000.08014.64
5.3.190.0070.08014.55
5.3.180.0070.04314.71
5.3.170.0070.07714.59
5.3.160.0130.05714.53
5.3.150.0100.07314.59
5.3.140.0030.06314.62
5.3.130.0030.07714.70
5.3.120.0100.03714.51
5.3.110.0030.03714.56
5.3.100.0070.07014.13
5.3.90.0000.04714.02
5.3.80.0100.06014.00
5.3.70.0130.07314.14
5.3.60.0100.07014.02
5.3.50.0100.04714.01
5.3.40.0100.03313.96
5.3.30.0030.04013.84
5.3.20.0100.06313.77
5.3.10.0030.07313.72
5.3.00.0270.02313.65
5.2.170.0100.04311.69
5.2.160.0070.04311.69
5.2.150.0070.05011.69
5.2.140.0030.05311.69
5.2.130.0070.03711.69
5.2.120.0030.02711.69
5.2.110.0000.06011.69
5.2.100.0000.05311.69
5.2.90.0030.03711.69
5.2.80.0130.05311.69
5.2.70.0070.06011.69
5.2.60.0030.06311.69
5.2.50.0030.06311.69
5.2.40.0030.03311.69
5.2.30.0070.06011.69
5.2.20.0070.03711.69
5.2.10.0000.04311.69
5.2.00.0100.02711.69
5.1.60.0030.05711.69
5.1.50.0100.03011.69
5.1.40.0030.03011.69
5.1.30.0100.04711.69
5.1.20.0030.04011.69
5.1.10.0030.03011.69
5.1.00.0000.02711.69
5.0.50.0000.02311.69
5.0.40.0000.04311.69
5.0.30.0030.03711.69
5.0.20.0000.02311.69
5.0.10.0070.03711.69
5.0.00.0000.03711.69
4.4.90.0030.03011.69
4.4.80.0030.02711.69
4.4.70.0000.03711.69
4.4.60.0000.04011.69
4.4.50.0000.03011.69
4.4.40.0070.05311.69
4.4.30.0030.03011.69
4.4.20.0030.01311.69
4.4.10.0030.01711.69
4.4.00.0000.02711.69
4.3.110.0030.02711.69
4.3.100.0030.01311.69
4.3.90.0030.03311.69
4.3.80.0030.04711.69
4.3.70.0000.01711.69
4.3.60.0070.02711.69
4.3.50.0000.03011.69
4.3.40.0030.04311.69
4.3.30.0000.03011.69
4.3.20.0030.03311.69
4.3.10.0030.01711.69
4.3.00.0000.03711.69

preferences:
50.02 ms | 401 KiB | 5 Q