PHP
declare(strict_types=1);
function steps(int $number): int{
if($number <=0) throw new InvalidArgumentException('Only positive numbers are allowed');
$counter = 0;
while($number >1){
if($number % 2 ==0){
$number /= 2;
}
else{
$number = 3*$number+1;
}
$counter +=1;
}
return $counter;
}