Similar to this question here which was intended for javascript, it has spawned off numerous spin-offs for various different languages. I'm curious if the following can ever evaluate to true in PHP:
($a == 1 && $a == 2 && $a == 3)
To follow up a bit more, it seems simply setting $a = true
will yield the desired result (This was not the case for javascript, due to the way type casting works in both languages). A few answers (in javascript) worked with ===
as well, so in PHP with typechecking (===
), can the following ever yield true?
($a === 1 && $a === 2 && $a === 3)