Just simplify
function getIDS(string $number) { return array_sum(array_map('intval', str_split($number))); }
- function getIDS(string $number) {
$number = str_split($number);array_walk($number, function($digit) use ($number) {return intval($digit);});return array_sum($number);- return array_sum(array_map('intval', str_split($number)));
- }