What is wrong with this php code?

echo "diff before ", $diff, "<br>";
if ($diff = 4 AND $num >= 3) {
echo "diff after ", $diff, "<br>";
}

What is making this string change and why is it running to start with when $diff is equal to 3?

When I run this I get:

diff before 3

diff after 4
 
Back
Top