14 karma · joined Dec 4, 2013 (12y ago) · 5 submissions
comment 12y ago · link · parent
> if( '33333333333333333333' == '33333333333333333334' ) echo "equal"; Output: "equal"
The "reason" for this very odd behaviour is that the two strings are automatically converted into integers, which leads to an int overflow, which PHP ignores (ignoring errors is very PHP specific) by guessing that the two "numbers" must be equal. I'm sure they even call this a feature...
comment 12y ago · link · parent