3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function betweenScope($num, $min, $max) { //$num = ($num > $max) ? $max : ((!$num < $min) ?: $min); if ($num > $max) { return $num; } else { if (!$num < $min) { return $num; } else { return $min; } } } echo betweenScope(21, 0, 5); echo betweenScope(3, 0, 5); echo betweenScope(-10, 0, 5);
Output for 4.3.0 - 7.1.0
2100