3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); for ($i = 0; $i < 1000000; $i++) { } return microtime(true) - $s; } function test2() { $s = microtime(true); $i = 0; while ($i < 1000000) { $i++; } return microtime(true) - $s; } function test3() { $s = microtime(true); $i = 0; while ($i++ < 1000000) { } return microtime(true) - $s; } function test4() { $s = microtime(true); for ($i = 0; $i < 1000000; $i++); return microtime(true) - $s; } function test5() { $s = microtime(true); $i = 0; while ($i++ < 1000000); return microtime(true) - $s; } echo test1() . "\n\n"; echo test2() . "\n\n"; echo test3() . "\n\n"; echo test4() . "\n\n"; echo test5() . "\n\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.0100.03914.82
7.3.110.0030.03814.91
7.3.100.0130.03815.03
7.3.90.0030.04114.60
7.3.80.0030.04814.74
7.3.70.0100.03914.97
7.3.60.0100.03914.74
7.3.50.0000.05214.84
7.3.40.0070.04414.98
7.3.30.0130.04014.91
7.3.20.0100.04316.72
7.3.10.0060.04216.75
7.3.00.0030.04216.56
7.2.240.0030.04915.18
7.2.230.0000.05414.95
7.2.220.0000.05115.18
7.2.210.0030.05115.03
7.2.200.0000.05215.21
7.2.190.0130.03815.22
7.2.180.0030.04615.04
7.2.170.0000.04215.03
7.2.160.0030.04314.94
7.2.150.0070.04616.86
7.2.140.0100.04317.07
7.2.130.0050.04416.84
7.2.120.0050.04716.85
7.2.110.0030.04816.96
7.2.100.0030.04516.86
7.2.90.0020.04917.04
7.2.80.0080.04116.88
7.2.70.0060.04016.93
7.2.60.0080.03916.95
7.2.50.0050.04216.92
7.2.40.0050.05516.90
7.2.30.0050.05617.03
7.2.20.0080.04016.96
7.2.10.0030.05416.85
7.2.00.0040.04317.61
7.1.330.0030.10915.71
7.1.320.0030.11015.95
7.1.310.0030.11115.86
7.1.300.0000.11515.82
7.1.290.0070.11315.97
7.1.280.0100.10515.64
7.1.270.0070.11015.54
7.1.260.0100.10315.74
7.1.250.0120.11315.83
7.1.240.0070.10615.82
7.1.230.0030.12515.70
7.1.220.0100.10615.77
7.1.210.0070.12515.87
7.1.200.0070.10515.90
7.1.190.0030.10915.95
7.1.180.0030.10615.63
7.1.170.0030.11115.43
7.1.160.0100.11615.75
7.1.150.0070.11315.72
7.1.140.0100.10715.51
7.1.130.0100.11215.83
7.1.120.0030.11815.80
7.1.110.0070.12215.95
7.1.100.0100.10616.04
7.1.90.0070.11415.64
7.1.80.0070.11015.77
7.1.70.0000.08116.61
7.1.60.0050.09617.43
7.1.50.0030.09116.23
7.1.40.0100.10615.50
7.1.30.0070.10615.70
7.1.20.0070.11815.92
7.1.10.0070.10815.94
7.1.00.0080.13218.92
7.0.330.0070.11115.37
7.0.320.0030.11415.38
7.0.310.0030.10915.46
7.0.300.0100.10915.04
7.0.290.0030.11515.04
7.0.280.0070.09615.39
7.0.270.0070.10615.09
7.0.260.0130.10415.36
7.0.250.0100.12614.98
7.0.240.0030.11415.27
7.0.230.0030.11015.21
7.0.220.0100.10615.42
7.0.210.0100.11115.55
7.0.200.0000.08416.09
7.0.190.0000.11015.18
7.0.180.0030.10415.57
7.0.170.0070.10315.45
7.0.160.0070.12015.33
7.0.150.0030.13015.21
7.0.140.0080.11718.84
7.0.130.0030.12015.60
7.0.120.0000.10515.32
7.0.110.0030.11015.22
7.0.100.0030.11115.43
7.0.90.0030.10915.34
7.0.80.0030.12715.50
7.0.70.0030.10415.41
7.0.60.0050.09417.62
7.0.50.0050.08916.56
7.0.40.0150.10117.04
7.0.30.0150.11516.62
7.0.20.0120.09516.77
7.0.10.0100.11416.87
7.0.00.0020.10616.71
5.6.380.0030.30714.38
5.6.370.0130.28714.13
5.6.360.0030.32914.45
5.6.350.0000.31914.38
5.6.340.0070.29214.49
5.6.330.0100.29714.52
5.6.320.0030.30413.99
5.6.310.0030.31514.68
5.6.300.0000.32114.38
5.6.290.0070.31314.31
5.6.280.0080.26517.46
5.6.270.0000.30114.59
5.6.260.0030.29214.24
5.6.250.0070.29814.46
5.6.240.0000.32314.33
5.6.230.0070.28614.18
5.6.220.0070.29514.62
5.6.210.0020.23017.33
5.6.200.0050.23916.26
5.6.190.0050.23517.51
5.6.180.0200.22417.46
5.6.170.0130.22817.56
5.6.160.0070.23417.49
5.6.150.0050.24416.14
5.6.140.0030.24616.15
5.6.130.0070.23416.39
5.6.120.0120.23517.77
5.6.110.0070.23217.82
5.6.100.0030.23117.52
5.6.90.0070.24617.56
5.6.80.0070.23917.16
5.6.70.2050.20617.40
5.6.60.0130.28413.91
5.6.50.0030.29314.51
5.6.40.0100.29514.37
5.6.30.0030.28014.11
5.6.20.0030.33214.15
5.6.10.0030.30014.18
5.6.00.0070.30314.35
5.5.380.0000.29010.90
5.5.370.0000.29611.18
5.5.360.0030.28711.16
5.5.350.0100.21015.71
5.5.340.0030.23814.48
5.5.330.0100.22415.77
5.5.320.0070.26315.65
5.5.310.0120.21615.85
5.5.300.0000.24614.75
5.5.290.0050.24014.61
5.5.280.0080.21715.90
5.5.270.0050.24716.01
5.5.260.0050.24815.85
5.5.250.0120.23615.75
5.5.240.0180.23415.70
5.5.230.0000.32910.90
5.5.220.0030.28110.96
5.5.210.0030.29411.20
5.5.200.0000.29411.16
5.5.190.0070.28810.90
5.5.180.0000.29311.21
5.5.170.0030.29011.10
5.5.160.0030.29311.14
5.5.150.0000.30611.14
5.5.140.0070.29911.16
5.5.130.0000.33111.08
5.5.120.0100.29010.96
5.5.110.0030.30211.29
5.5.100.0030.30110.90
5.5.90.0030.31011.02
5.5.80.0000.32510.90
5.5.70.0000.32110.93
5.5.60.0070.28910.90
5.5.50.0000.35010.90
5.5.40.0000.34211.14
5.5.30.0030.32510.90
5.5.20.0030.28111.02
5.5.10.0030.30410.90
5.5.00.0000.28911.30
5.4.450.0380.26415.24
5.4.440.0130.26515.45
5.4.430.0130.23815.25
5.4.420.0120.23615.41
5.4.410.0170.25715.29
5.4.400.0150.25014.98
5.4.390.0050.25415.14
5.4.380.0180.24714.85
5.4.370.0130.25214.84
5.4.360.0120.26114.69
5.4.350.0120.24414.95
5.4.340.0120.25714.87
5.4.330.0030.28510.91
5.4.320.0070.22811.71
5.4.310.0060.22511.71
5.4.300.0060.23211.86
5.4.290.0040.25411.74
5.4.280.0070.26511.64
5.4.270.0090.28111.64
5.4.260.0050.30811.64
5.4.250.0060.25611.71
5.4.240.0060.28011.70
5.4.230.0090.27211.64
5.4.220.0080.28811.64
5.4.210.0060.27811.64
5.4.200.0080.25711.64
5.4.190.0060.26911.70
5.4.180.0050.24911.63
5.4.170.0040.22511.76
5.4.160.0080.27611.64
5.4.150.0080.30311.68
5.4.140.0070.25111.47
5.4.130.0060.23811.58
5.4.120.0090.25811.45
5.4.110.0050.25111.45
5.4.100.0070.23911.54
5.4.90.0070.22611.63
5.4.80.0050.23411.50
5.4.70.0060.24011.45
5.4.60.0090.27111.61
5.4.50.0090.27711.45
5.4.40.0080.27711.53
5.4.30.0120.26311.51
5.4.20.0060.26011.54
5.4.10.0100.25311.48
5.4.00.0090.27111.19
5.3.290.0050.25411.85
5.3.280.0040.33311.80
5.3.270.0070.29711.81
5.3.260.0310.28711.81
5.3.250.0070.28311.81
5.3.240.0040.25111.81
5.3.230.0070.25111.80
5.3.220.0050.25111.79
5.3.210.0060.29611.79
5.3.200.0050.28811.79
5.3.190.0070.26111.79
5.3.180.0060.24611.78
5.3.170.0080.26511.78
5.3.160.0080.27411.79
5.3.150.0040.25911.79
5.3.140.0100.26111.78
5.3.130.0050.29011.78
5.3.120.0080.28911.78
5.3.110.0100.30311.78
5.3.100.0040.27911.51
5.3.90.0070.31011.50
5.3.80.0070.33111.49
5.3.70.0060.30211.49
5.3.60.0060.31111.48
5.3.50.0070.34211.46
5.3.40.0110.30911.46
5.3.30.0140.31011.44
5.3.20.0080.28011.33
5.3.10.0080.28211.31
5.3.00.0050.28611.30
5.2.170.0100.38210.05
5.2.160.0040.37510.05
5.2.150.0100.38110.05
5.2.140.0130.40810.05
5.2.130.0110.34710.03
5.2.120.0110.37710.03
5.2.110.0090.37810.04
5.2.100.0080.35310.03
5.2.90.0090.38210.03
5.2.80.0120.38710.03
5.2.70.0120.42110.03
5.2.60.0280.41910.01
5.2.50.0090.38210.00
5.2.40.0040.3919.98
5.2.30.0100.3539.97
5.2.20.0110.3719.96
5.2.10.0110.3299.92
5.2.00.0070.3529.86
5.1.60.0060.3629.50
5.1.50.0070.3449.50
5.1.40.0060.4699.49
5.1.30.0050.4289.66
5.1.20.0050.4079.68
5.1.10.0110.4199.54
5.1.00.0090.3999.54
5.0.50.0090.8848.78
5.0.40.0060.8718.71
5.0.30.0090.8828.62
5.0.20.0060.8248.60
5.0.10.0040.7928.59
5.0.00.0040.7968.58
4.4.90.0101.0517.84
4.4.80.0040.9347.83
4.4.70.0050.9087.83
4.4.60.0140.8877.82
4.4.50.0130.9977.84
4.4.40.0040.8697.80
4.4.30.0080.9777.83
4.4.20.0060.7787.87
4.4.10.0050.6797.88
4.4.00.0020.6427.83
4.3.110.0060.6507.78
4.3.100.0040.7407.78
4.3.90.0020.6957.77
4.3.80.0010.6517.74
4.3.70.0060.7587.77
4.3.60.0030.7457.76
4.3.50.0040.6937.76
4.3.40.0050.6367.72
4.3.30.0070.6517.12
4.3.20.0010.8357.11
4.3.10.0130.7467.09
4.3.00.0030.60010.60

preferences:
35.73 ms | 401 KiB | 5 Q