3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_digits($digit) { // TODO: add type validation return $digit >= 10 ? 1 + count_digits($digit / 10) : 1; } $digit = 1554; $tries = 10000; $start = microtime(true); for ($i = 0; $i < $tries; $i++) { count_digits($digit); } echo (microtime(true) - $start); $start = microtime(true); for ($i = 0; $i < $tries; $i++) { strlen($digit); } echo (microtime(true) - $start);

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.10.0120.00816.57
7.3.00.0110.01116.59
7.2.130.0140.00716.65
7.2.120.0140.00716.92
7.2.110.0040.01216.63
7.2.100.0030.01616.76
7.2.90.0060.00616.77
7.2.80.0090.00916.61
7.2.70.0060.01216.49
7.2.60.0100.01016.78
7.2.50.0100.01316.75
7.2.40.0050.01417.00
7.2.30.0110.00917.03
7.2.20.0160.00916.71
7.2.10.0060.01316.66
7.2.00.0080.00918.12
7.1.250.0070.01415.77
7.1.70.0000.00917.30
7.1.60.0100.01719.21
7.1.50.0070.01617.02
7.1.00.0000.03722.44
7.0.200.0540.00714.55
7.0.140.0070.07022.06
7.0.60.0070.09019.88
7.0.50.0100.04017.88
7.0.40.0100.06320.30
7.0.30.0230.04720.24
7.0.20.0300.05320.33
7.0.10.0300.08020.20
7.0.00.0070.04320.14
5.6.280.0070.08021.04
5.6.210.0130.09020.47
5.6.200.0070.05718.19
5.6.190.0070.09720.46
5.6.180.0300.07720.44
5.6.170.0200.04320.48
5.6.160.0100.06020.46
5.6.150.0070.07318.18
5.6.140.0100.08018.23
5.6.130.0070.06318.21
5.6.120.0030.06020.97
5.6.110.0030.09721.03
5.6.100.0030.10021.03
5.6.90.0030.05021.00
5.6.80.0070.04320.46
5.6.70.0300.08020.31
5.5.350.0230.09320.41
5.5.340.0030.04717.99
5.5.330.0070.06720.37
5.5.320.0170.08020.38
5.5.310.0330.09320.27
5.5.300.0100.04018.05
5.5.290.0070.09718.03
5.5.280.0030.05720.80
5.5.270.0130.08720.89
5.5.260.0130.07020.96
5.5.250.0100.10020.63
5.5.240.0030.08320.26
5.4.450.0630.09719.34
5.4.440.0270.05719.21
5.4.430.0130.06319.19
5.4.420.0200.05719.33
5.4.410.0170.06019.46
5.4.400.0430.08018.81
5.4.390.0600.08718.75
5.4.380.0200.06718.61
5.4.370.0200.05318.46
5.4.360.0130.06018.60
5.4.350.0080.04112.02
5.4.340.0030.04612.02
5.4.320.0040.04912.51
5.4.310.0080.05012.50
5.4.300.0060.04312.50
5.4.290.0080.04212.50
5.4.280.0070.04412.40
5.4.270.0020.04712.40
5.4.260.0090.03912.40
5.4.250.0030.06318.75
5.4.240.0130.05319.05
5.4.230.0070.06018.72
5.4.220.0100.06018.95
5.4.210.0100.05718.72
5.4.200.0100.07718.85
5.4.190.0200.05318.80
5.4.180.0030.06718.95
5.4.170.0130.05318.95
5.4.160.0030.06318.87
5.4.150.0170.08018.97
5.4.140.0100.05316.38
5.4.130.0070.06016.38
5.4.120.0100.05316.42
5.4.110.0100.05716.48
5.4.100.0000.06716.48
5.4.90.0070.06016.36
5.4.80.0070.05716.59
5.4.70.0130.05016.42
5.4.60.0170.05316.29
5.4.50.0130.07316.41
5.4.40.0030.06716.49
5.4.30.0130.04716.28
5.4.20.0030.06316.36
5.4.10.0130.07316.41
5.4.00.0130.08015.76
5.3.290.0090.04912.80
5.3.280.0070.07714.82
5.3.270.0030.06714.68
5.3.260.0200.05014.69
5.3.250.0030.07014.43
5.3.240.0070.06014.68
5.3.230.0100.06314.57
5.3.220.0170.05314.66
5.3.210.0070.06314.58
5.3.200.0000.06714.55
5.3.190.0100.05714.65
5.3.180.0030.06314.39
5.3.170.0030.06714.57
5.3.160.0130.08714.64
5.3.150.0100.06014.69
5.3.140.0100.06014.64
5.3.130.0170.05714.38
5.3.120.0100.06314.54
5.3.110.0130.05714.38
5.3.100.0030.06314.02
5.3.90.0030.06314.02
5.3.80.0130.05314.09
5.3.70.0070.06014.08
5.3.60.0070.06014.17
5.3.50.0000.06713.95
5.3.40.0070.07713.99
5.3.30.0070.05713.89
5.3.20.0070.06013.66
5.3.10.0130.05013.74
5.3.00.0130.05013.82
5.2.170.0070.06311.30
5.2.160.0000.06011.10
5.2.150.0000.06011.09
5.2.140.0100.05711.09
5.2.130.0100.05011.00
5.2.120.0070.05311.26
5.2.110.0030.05311.32
5.2.100.0070.05311.26
5.2.90.0100.05311.28
5.2.80.0130.05011.15
5.2.70.0000.07011.18
5.2.60.0100.05311.01
5.2.50.0030.06311.09
5.2.40.0170.04711.07
5.2.30.0070.05711.05
5.2.20.0070.06011.03
5.2.10.0030.05310.84
5.2.00.0070.06310.72
5.1.60.0070.0479.97
5.1.50.0070.0539.83
5.1.40.0000.0539.97
5.1.30.0170.06310.41
5.1.20.0100.06310.34
5.1.10.0100.06010.16
5.1.00.0170.07010.16
5.0.50.0030.0908.38
5.0.40.0100.0508.24
5.0.30.0070.0778.42
5.0.20.0070.0678.11
5.0.10.0170.0638.27
5.0.00.0070.0778.21
4.4.90.0070.0637.38
4.4.80.0030.0807.38
4.4.70.0000.0677.38
4.4.60.0030.0777.38
4.4.50.0000.0707.38
4.4.40.0070.0637.38
4.4.30.0000.0507.38
4.4.20.0070.0507.38
4.4.10.0000.0537.38
4.4.00.0000.0637.38
4.3.110.0000.0537.38
4.3.100.0070.0477.38
4.3.90.0070.0707.38
4.3.80.0030.0777.38
4.3.70.0000.0537.38
4.3.60.0100.0677.38
4.3.50.0070.0507.38
4.3.40.0000.0607.38
4.3.30.0030.0477.38
4.3.20.0000.0537.38
4.3.10.0000.0507.38
4.3.00.0030.0476.41

preferences:
36.72 ms | 400 KiB | 5 Q