3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); for ($i = 0; $i < 10000; $i++) { } return microtime(true) - $s; } function test2() { $s = microtime(true); $i = 0; while ($i < 10000) { $i++; } return microtime(true) - $s; } function test3() { $s = microtime(true); $i = 0; while ($i++ < 10000) { } return microtime(true) - $s; } function test4() { $s = microtime(true); $range = range(0, 9999); foreach ($range as $i) { } return microtime(true) - $s; } echo test1() . "\n\n"; echo test2() . "\n\n"; echo test3() . "\n\n"; echo test4() . "\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.4.10.0070.01015.40
7.4.00.0100.01015.37
7.3.130.0090.00915.26
7.3.120.0030.01615.20
7.3.110.0070.01315.32
7.3.100.0090.00915.18
7.3.90.0030.01015.19
7.3.80.0040.01115.36
7.3.70.0100.00315.20
7.3.60.0090.00615.30
7.3.50.0090.00615.31
7.3.40.0030.01315.28
7.3.30.0000.00915.24
7.3.20.0070.01016.54
7.3.10.0060.00916.58
7.3.00.0070.00716.64
7.2.260.0090.00915.21
7.2.250.0120.00815.58
7.2.240.0000.01515.29
7.2.230.0070.00315.53
7.2.220.0040.01115.53
7.2.210.0090.00615.48
7.2.200.0060.01015.32
7.2.190.0070.01115.39
7.2.180.0060.00915.50
7.2.170.0030.01315.23
7.2.160.0030.00715.50
7.2.150.0090.00616.78
7.2.140.0070.01017.02
7.2.130.0030.01117.00
7.2.120.0040.00816.93
7.2.110.0060.00616.92
7.2.100.0040.01116.93
7.2.90.0000.01516.81
7.2.80.0030.01017.05
7.2.70.0070.01117.02
7.2.60.0040.00716.69
7.2.50.0030.01216.95
7.2.40.0080.00817.01
7.2.30.0000.01617.03
7.2.20.0000.01216.96
7.2.10.0030.01216.95
7.2.00.0070.00718.19
7.1.330.0070.00715.91
7.1.320.0000.01515.90
7.1.310.0030.01315.88
7.1.300.0090.00615.80
7.1.290.0040.01515.59
7.1.280.0000.01715.50
7.1.270.0030.00915.78
7.1.260.0040.01515.68
7.1.250.0060.00615.62
7.1.240.0040.00715.72
7.1.230.0060.00915.77
7.1.220.0000.01515.93
7.1.210.0060.00915.94
7.1.200.0060.00315.83
7.1.190.0040.00815.79
7.1.180.0030.01315.78
7.1.170.0060.00915.80
7.1.160.0040.01115.99
7.1.150.0060.00315.63
7.1.140.0000.01515.77
7.1.130.0060.00915.87
7.1.120.0040.01115.75
7.1.110.0040.01115.82
7.1.100.0090.00315.81
7.1.90.0100.00716.01
7.1.80.0040.01515.97
7.1.70.0030.01016.45
7.1.60.0050.01317.68
7.1.50.0080.01016.37
7.1.40.0040.01415.73
7.1.30.0000.01315.73
7.1.20.0030.01315.85
7.1.10.0030.01315.95
7.1.00.0070.04419.08
7.0.330.0140.00315.54
7.0.320.0030.00815.44
7.0.310.0080.00815.50
7.0.300.0030.00615.35
7.0.290.0080.00615.51
7.0.280.0030.00715.55
7.0.270.0030.00615.48
7.0.260.0000.01015.43
7.0.250.0000.01615.34
7.0.240.0060.00915.27
7.0.230.0070.00715.47
7.0.220.0070.01015.56
7.0.210.0070.00715.36
7.0.200.0050.00916.20
7.0.190.0030.01215.45
7.0.180.0070.00715.53
7.0.170.0060.01015.58
7.0.160.0070.00715.58
7.0.150.0060.00915.51
7.0.140.0080.03718.72
7.0.130.0090.00615.48
7.0.120.0070.01015.38
7.0.110.0070.00715.45
7.0.100.0000.01415.59
7.0.90.0110.00715.54
7.0.80.0030.01315.47
7.0.70.0070.00315.56
7.0.60.0050.02318.02
7.0.50.0070.02016.94
7.0.40.0100.02316.91
7.0.30.0170.03316.80
7.0.20.0130.02216.76
7.0.10.0060.03016.85
7.0.00.0050.03316.95
5.6.400.0130.00615.33
5.6.390.0040.01815.65
5.6.380.0000.02115.69
5.6.370.0000.01715.89
5.6.360.0080.01115.59
5.6.350.0000.02215.64
5.6.340.0120.00615.64
5.6.330.0100.00315.47
5.6.320.0040.01115.75
5.6.310.0070.01315.50
5.6.300.0080.00615.79
5.6.290.0070.01415.48
5.6.280.0080.04719.13
5.6.270.0100.01015.72
5.6.260.0040.01515.33
5.6.250.0120.00615.70
5.6.240.0070.01415.57
5.6.230.0060.01515.73
5.6.220.0070.01015.34
5.6.210.0080.04518.73
5.6.200.0110.03717.58
5.6.190.0050.05218.59
5.6.180.0130.03718.76
5.6.170.0180.02318.55
5.6.160.0130.04118.66
5.6.150.0030.05017.51
5.6.140.0070.04617.64
5.6.130.0070.03317.57
5.6.120.0030.03319.06
5.6.110.0080.05019.01
5.6.100.0070.04718.99
5.6.90.0070.02818.92
5.6.80.0070.04718.57
5.6.70.2200.02918.55
5.6.60.0030.01815.30
5.6.50.0060.01515.52
5.6.40.0060.01215.61
5.6.30.0120.00615.75
5.6.20.0000.01715.40
5.6.10.0030.01415.67
5.6.00.0060.01315.44
5.5.380.0030.01715.30
5.5.370.0060.01215.77
5.5.360.0070.01315.65
5.5.350.0080.02318.63
5.5.340.0050.03417.49
5.5.330.0110.04618.53
5.5.320.0050.05418.49
5.5.310.0120.03018.51
5.5.300.0130.02517.34
5.5.290.0050.04717.53
5.5.280.0070.02518.83
5.5.270.0050.05218.97
5.5.260.0020.04618.79
5.5.250.0090.04018.71
5.5.240.0180.04218.61
5.5.230.0060.01315.63
5.5.220.0100.01015.86
5.5.210.0070.01015.27
5.5.200.0120.00615.82
5.5.190.0090.01215.50
5.5.180.0030.01015.68
5.5.170.0100.01015.41
5.5.160.0130.00615.71
5.5.150.0040.01115.48
5.5.140.0030.01515.53
5.5.130.0000.02015.58
5.5.120.0030.01315.23
5.5.110.0030.01715.70
5.5.100.0090.00915.35
5.5.90.0090.00915.62
5.5.80.0070.01415.65
5.5.70.0140.00715.54
5.5.60.0090.00915.55
5.5.50.0140.00715.39
5.5.40.0120.00915.51
5.5.30.0060.01215.36
5.5.20.0090.00915.36
5.5.10.0030.01915.51
5.5.00.0070.01015.41
5.4.450.0520.04416.54
5.4.440.0100.04016.55
5.4.430.0270.04116.50
5.4.420.0180.03016.53
5.4.410.0150.03616.36
5.4.400.0200.04016.45
5.4.390.0130.04416.49
5.4.380.0100.04016.05
5.4.370.0100.03916.03
5.4.360.0200.03816.14
5.4.350.0260.03016.25
5.4.340.0140.04116.06
5.4.330.0100.00712.52
5.4.320.0020.03013.13
5.4.310.0040.02512.98
5.4.300.0040.02612.86
5.4.290.0090.02113.18
5.4.280.0070.03612.94
5.4.270.0090.03213.10
5.4.260.0120.03212.95
5.4.250.0040.03712.98
5.4.240.0080.03412.83
5.4.230.0070.03512.79
5.4.220.0110.03512.87
5.4.210.0130.04513.03
5.4.200.0050.03912.87
5.4.190.0080.03312.93
5.4.180.0110.03312.99
5.4.170.0100.03913.08
5.4.160.0150.05113.09
5.4.150.0110.03013.10
5.4.140.0040.03612.90
5.4.130.0050.03612.73
5.4.120.0060.03512.72
5.4.110.0070.04812.76
5.4.100.0120.03212.79
5.4.90.0120.03112.91
5.4.80.0070.03112.89
5.4.70.0070.03112.86
5.4.60.0040.03112.79
5.4.50.0100.03212.90
5.4.40.0080.03212.68
5.4.30.0100.02812.72
5.4.20.0080.03312.75
5.4.10.0060.03412.88
5.4.00.0060.03512.45
5.3.290.0060.02712.74
5.3.280.0060.03512.67
5.3.270.0090.03812.84
5.3.260.0070.03812.84
5.3.250.0060.03712.82
5.3.240.0050.03912.78
5.3.230.0090.03512.73
5.3.220.0070.03812.62
5.3.210.0100.03112.71
5.3.200.0050.03412.69
5.3.190.0080.02912.68
5.3.180.0120.02612.64
5.3.170.0050.02712.71
5.3.160.0040.03112.71
5.3.150.0110.03112.69
5.3.140.0050.03712.79
5.3.130.0040.03612.73
5.3.120.0040.03012.75
5.3.110.0070.03612.77
5.3.100.0060.03512.53
5.3.90.0070.03412.37
5.3.80.0080.03212.24
5.3.70.0060.03012.39
5.3.60.0070.03212.43
5.3.50.0140.02712.41
5.3.40.0050.03312.39
5.3.30.0070.02712.30
5.3.20.0050.02512.17
5.3.10.0080.02812.00
5.3.00.0120.05712.04
5.2.170.0190.06810.43
5.2.160.0070.05010.55
5.2.150.0080.04810.43
5.2.140.0110.04710.43
5.2.130.0050.04710.39
5.2.120.0100.04310.39
5.2.110.0080.04610.39
5.2.100.0120.04610.39
5.2.90.0070.05310.39
5.2.80.0110.04910.38
5.2.70.0120.04410.38
5.2.60.0130.04710.34
5.2.50.0050.05410.31
5.2.40.0080.04610.27
5.2.30.0090.04610.26
5.2.20.0120.04610.24
5.2.10.0070.03110.30
5.2.00.0060.03610.03
5.1.60.0050.0309.82
5.1.50.0080.0359.82
5.1.40.0080.0429.80
5.1.30.0040.04810.14
5.1.20.0100.04410.17
5.1.10.0120.0419.90
5.1.00.0110.0439.90
5.0.50.0080.0388.37
5.0.40.0060.0328.24
5.0.30.0060.0398.05
5.0.20.0070.0298.02
5.0.10.0090.0378.00
5.0.00.0070.0477.99
4.4.90.0040.0226.42
4.4.80.0060.0196.41
4.4.70.0040.0216.41
4.4.60.0070.0216.41
4.4.50.0090.0166.42
4.4.40.0070.0326.41
4.4.30.0080.0236.41
4.4.20.0050.0216.47
4.4.10.0040.0296.47
4.4.00.0050.0296.44
4.3.110.0060.0186.35
4.3.100.0040.0216.34
4.3.90.0040.0216.37
4.3.80.0040.0326.32
4.3.70.0040.0226.32
4.3.60.0020.0246.32
4.3.50.0050.0226.32
4.3.40.0030.0336.27
4.3.30.0030.0235.07
4.3.20.0070.0205.05
4.3.10.0040.0275.02
4.3.00.0300.03010.30

preferences:
26.35 ms | 401 KiB | 5 Q