<?php class Calculator { public function add(...$numbers) { $total = 0; foreach($numbers as $number){ if(is_numeric($number)){ $total += $number; }else{ throw new Exception ("All the number must be numeric") } } return $total; } public function divide($a, $b) { $total = 0; if(is_numeric($a) && is_numeric($b)){ $total = $a / $b; }else{ throw new Exception ("All the number must be numeric") } return $total; } }