<?php
function divide($divident, $divisor) {
if(!is_numeric($divident) || !is_numeric($divisor)) {
throw new InvalidArgumentException("Function accepts only numeric values");
}
if($divisor == 0) {
throw new DomainException("Divisor must not be zero");
}
return $divident / $divisor;
}