Is one of the following functions better than the other in terms of placement of the return return statement?
Function # 1:
function equalToTwo($a, $b)
{
$c = $a + $b;
if($c == 2)
{
return true;
}
return false;
}
Function No. 2:
function equalToTwo($a, $b)
{
$c = $a + $b;
if($c == 2)
{
return true;
}
else
{
return false;
}
}
Thank!
source
share