What are the potential pitfalls of using comparison operators incorrectly in PHP code, as seen in the provided example?

Using comparison operators incorrectly in PHP code can lead to unexpected results or errors. For example, using the `=` operator instead of `==` or `===` for comparison can inadvertently assign a value instead of comparing it. To avoid this pitfall, always use the correct comparison operator based on the intended logic.

// Incorrect comparison using assignment operator
$number = 5;
if ($number = 10) {
    echo "Number is 10";
}

// Correct comparison using equality operator
$number = 5;
if ($number == 10) {
    echo "Number is 10";
}