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; } $digit = 1554; $tries = 10000; var_dump(count_digits($digit, 2), decbin($digit));
Output for git.master, git.master_jit, rfc.property-hooks
int(11) string(11) "11000010010"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.82 ms | 401 KiB | 8 Q