Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
determine if a value is within range
/**
* Determine if a numeric value is within range
*
* @return bool
*/
function between($subject, $min, $max): bool {
if (!is_numeric($subject) {
throw new LogicException;
}
return $subject >= $min and $subject <= $max;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.