3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function variations($length, $chars) { $unique_chars = count_chars($chars, 3); if ($length <= 0 || $unique_chars <= 0) return 0; $additional = ($length > 1) ? variations($length - 1, $chars) : 0; return pow($unique_chars, $length) + $additional; } echo number_format(variations(15, 62));
Output for 4.3.0 - 4.3.1, 5.2.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1,744,349,715,977,155,117,056
Output for 4.3.2 - 5.2.0
1,744,349,715,977,155,200,000