- var_dump: documentation ( source)
<?php
function betweenScope($num, $min, $max)
{
//$num = ($num > $max) ? $max : ((!$num < $min) ?: $min);
if ($num > $max)
{
return $num;
} else
{
echo $num . ':' . $min;
var_dump(($num < $min));
if (!$num < $min)
{
return $num;
} else
{
return $min;
}
}
}
//echo betweenScope(21, 0, 5) . PHP_EOL;
echo betweenScope(3, 0, 5) . PHP_EOL;
//echo betweenScope(-10, 0, 5) . PHP_EOL;