Is there such a thing?
for eg
$var = -5; echo thefunction($var); // should be 0 $var = 5; echo thefunction($var); // should be 5
Simply:
echo $var < 0 ? 0 : $var;