Comment by user3939382
16 hours ago
In what context are you doing if("0")? People always have these obscure type comparison complaints, not just for PHP, and all I can think is why would you write that?
16 hours ago
In what context are you doing if("0")? People always have these obscure type comparison complaints, not just for PHP, and all I can think is why would you write that?
Something you'll see in real codebases is code that cares whether an input value is "empty", but it doesn't matter if it's null or an empty string. It's very easy to go for this:
It'll work through every test case you try, and then someone enters a 0 into the field and it's also unexpectedly considered empty.