What are some potential pitfalls of using break, exit, or continue within if-else statements in PHP?

Using break, exit, or continue within if-else statements can lead to unexpected behavior or unintended consequences in PHP code. To avoid this, it's important to carefully plan the logic flow and consider using return statements to exit early from functions or methods when needed.

// Example of using return instead of break in an if-else statement
function checkNumber($num) {
    if ($num < 0) {
        return "Negative number";
    } else {
        return "Positive number";
    }
}

echo checkNumber(-5); // Output: Negative number