What are the potential pitfalls of using "break" in an if statement in PHP?

Using "break" in an if statement in PHP can lead to unexpected behavior as "break" is typically used within loops like "for" or "while". To avoid this issue, it is recommended to use "return" instead of "break" to exit out of an if statement.

// Incorrect usage of "break" in an if statement
if ($condition) {
    // do something
    break;
}

// Correct usage of "return" to exit out of an if statement
if ($condition) {
    // do something
    return;
}