Skip to content

Commit f94d9b5

Browse files
committed
Add extra typecheck
1 parent 31ba226 commit f94d9b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

6 Kyu/persistent-bugger.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ function altPersistence(int $num): int
5454
{
5555
// Ensure that $num is an integer
5656
$num = (int)$num;
57+
$splitNum = str_split($num);
58+
if (true===$splitNum) {
59+
return 0;
60+
}
5761
$count = 0;
5862
while ($num > 9) {
59-
$num = array_product(str_split($num));
63+
$num = array_product($splitNum);
6064
$count++;
6165
}
6266

0 commit comments

Comments
 (0)