function user_pow(int $number, int $degree) {
if ($number <= 0 || $degree < 0) throw new \InvalidArgumentException('Invalid arguments');
if ($degree === 0) return 1;
$result = $number;
for($i = 1; $i < $degree; $i++) {
$result *= $number;
}
return $result;
}
echo user_pow(2, 2); // 4