12 ms·
I know about ===. I do understand how type conversion works. I just don't think that it works "correctly". Converting "0" to 0 implicitly seems completely illog
by 10098 14y ago
I know about ===. I do understand how type conversion works. I just don't think that it works "correctly". Converting "0" to 0 implicitly seems completely illogical to me. A string is not a number.
- dr42 14y ago"a string is not a number" Well then use ===, but when a string contains numbers then php will do the type conversion for you. It's a convenience. It may not work correctly by your definition but it's pretty intuitive and useful the way it is.