I'm declaring a var $t
and assigning it a value of 0. I then reassign $t
a new value of test
. It then appears that $t
is both 0
AND test
. Here's the code:
$t = 0;
$t = "test";
if($t == 0 && $t == "test"){
echo "unexpected";
}else{
echo "expected";
}
The output is:
"unexpected"
Can someone please explain what is going on here? Is $t
really two different values (0
and test
) at the same time or am I missing something?