What are the potential pitfalls of using "=" instead of "==" in PHP conditional statements?

Using "=" instead of "==" in PHP conditional statements can lead to unintended behavior because "=" is an assignment operator, while "==" is a comparison operator. This means that using "=" will assign a value to the variable on the left side of the statement, rather than comparing the values on both sides. To avoid this issue, always use "==" when comparing values in conditional statements.

// Incorrect usage of "=" instead of "=="
$number = 5;

if($number = 10) {
    echo "This will always be true";
}

// Corrected code using "=="
$number = 5;

if($number == 10) {
    echo "This will not be executed";
}