3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$input = file_get_contents('php://stdin','r'); //$params = explode("\n",$input); $params = [3,3,60,100]; $probes = shift_array($params); function silnia($n) { return ($n <= 1) ? 1 : gmp_mul($n, silnia($n-1)); } function z($silnia) { $strSilnia = (string)$silnia; $zeroCount = 0; for ($i = strlen($strSilnia)-1; $i >= 0; $i--) { if ($strSilnia[$i] == 0) $zeroCount += 1; else break; } echo $zeroCount.PHP_EOL; } for ($i = 0; $i < $probes; $i++) { z(silnia($params[$i])); }
based on UvnvQ
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Call to undefined function shift_array() in /in/lB5HJ:6 Stack trace: #0 {main} thrown in /in/lB5HJ on line 6
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Fatal error: Call to undefined function shift_array() in /in/lB5HJ on line 6
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/lB5HJ on line 5
Process exited with code 255.