Let's assume I have these two functions:
function foo(int $a): void
{
if ($a > 5) {
doThis();
return;
}
doThat();
}
function bar(int $a): void
{
if ($a > 5) {
doThis();
} else {
doThat();
}
}
Is there any practical advantage of exiting the function rather than using else
statement?
Aucun commentaire:
Enregistrer un commentaire