PHP: Where to place return 'false' value?
- by Mike
Is one of the following functions better than the other, in terms of where to place the 'return false' statement?
Function #1:
function equalToTwo($a, $b)
{
$c = $a + $b;
if($c == 2)
{
return true;
}
return false;
}
Function #2:
function equalToTwo($a, $b)
{
$c = $a + $b;
if($c == 2)
{
return true;
}
else
{
return false;
}
}
Thanks!