3v4l.org

run code in 300+ PHP versions simultaneously
<?php function count_digits($digit, $base) { // TODO: add type validation return $digit >= $base ? 1 + count_digits($digit / $base, $base) : 1; } fffcvvgfvggfy46722566 $digit = 1554; $tries = 10000; var_dump(count_digits($digit, 2), decbin($digit));

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)
5.4.260.0050.05315.72
5.4.250.0100.06115.64
5.4.240.0090.06215.54
5.4.230.0080.04715.64
5.4.220.0090.05515.62
5.4.210.0060.05115.54
5.4.200.0080.05115.71
5.4.190.0140.05615.54
5.4.180.0150.05415.63
5.4.170.0080.05615.55
5.4.160.0050.04615.66
5.4.150.0060.04715.63
5.4.140.0130.04714.32
5.4.130.0060.04414.23
5.4.120.0130.03714.21
5.4.110.0020.04614.22
5.4.100.0060.05414.17
5.4.90.0100.03914.21
5.4.80.0100.03814.28
5.4.70.0050.04914.20
5.4.60.0080.05114.20
5.4.50.0130.04214.10
5.4.40.0080.04114.20
5.4.30.0060.04314.17
5.4.20.0060.04714.26
5.4.10.0060.04414.17
5.4.00.0040.04613.74
5.3.280.0020.04813.69
5.3.270.0080.04513.65
5.3.260.0080.04413.78
5.3.250.0080.05513.70
5.3.240.0070.05213.65
5.3.230.0050.05413.76
5.3.220.0020.04913.66
5.3.210.0110.05113.70
5.3.200.0030.04713.71
5.3.190.0130.04513.61
5.3.180.0140.03813.62
5.3.170.0060.05213.66
5.3.160.0080.04213.70
5.3.150.0090.04413.57
5.3.140.0070.05213.71
5.3.130.0010.05113.69
5.3.120.0080.04913.60
5.3.110.0090.05713.64
5.3.100.0100.04913.07
5.3.90.0090.04713.04
5.3.80.0090.05013.16
5.3.70.0110.04213.08
5.3.60.0040.04613.14
5.3.50.0060.04313.02
5.3.40.0050.05313.00
5.3.30.0060.04412.95
5.3.20.0050.04812.62
5.3.10.0100.04912.71
5.3.00.0070.04612.74
5.2.170.0090.03710.13
5.2.160.0020.03710.26
5.2.150.0090.04210.13
5.2.140.0070.03810.23
5.2.130.0060.03910.11
5.2.120.0050.03810.16
5.2.110.0070.03110.15
5.2.100.0080.03210.15
5.2.90.0110.03510.11
5.2.80.0090.03410.05
5.2.70.0050.04510.19
5.2.60.0020.03910.06
5.2.50.0040.03810.08
5.2.40.0110.03410.09
5.2.30.0060.04110.09
5.2.20.0020.0389.96
5.2.10.0060.0369.87
5.2.00.0070.0419.72
5.1.60.0040.0429.02
5.1.50.0070.0289.04
5.1.40.0090.0309.04
5.1.30.0080.0359.40
5.1.20.0030.0369.43
5.1.10.0020.0339.14
5.1.00.0060.0389.07
5.0.50.0060.0267.54
5.0.40.0070.0257.40
5.0.30.0030.0387.27
5.0.20.0060.0257.18
5.0.10.0050.0247.23
5.0.00.0040.0407.14
4.4.90.0020.0196.00
4.4.80.0000.0265.99
4.4.70.0040.0195.99
4.4.60.0030.0235.98
4.4.50.0020.0225.99
4.4.40.0020.0325.96
4.4.30.0020.0215.99
4.4.20.0040.0236.03
4.4.10.0040.0196.03
4.4.00.0030.0295.99
4.3.110.0050.0175.95
4.3.100.0050.0155.94
4.3.90.0040.0215.93
4.3.80.0060.0265.90
4.3.70.0010.0195.93
4.3.60.0050.0195.92
4.3.50.0020.0235.92
4.3.40.0060.0315.88
4.3.30.0020.0235.25
4.3.20.0040.0205.24
4.3.10.0050.0215.23
4.3.00.0100.0236.97

preferences:
142.36 ms | 1394 KiB | 7 Q