Post #3683567
2026-07-08 23:19 UTC
Sometimes I truly believe that I have grasped all of the weird semantics of #PHP, and then I discover something so simple that breaks an assumption I had about the language.
I knew that `NAN == X` can return `true`.
I knew that the comparison operators are not transitive.
I *obviously* knew that `"0" == 0` and `"0" == false` return true.
And yet it was *foolish* of me to believe that all instance of `X == false` would give the same answer as `X == null`.
As TIL `"0" == null` is false.
Replies (1)
-
@saramg@fosstodon.org 2026-07-08 23:47
@Girgias@phpc.social I have been using PHP for as long as you have been alive and only JUST learned this past year (from you, possibly) that this bullshirt is valid syntax (but deprecated as of 8.5). https://3v4l.org/HVvWL This old gal can still surprise us.