scrutinizer-ci/scrutinizer

int + int * int wrongly interpreted as double

donatj opened this issue · 2 comments

fgm commented

Not necessarily: if the value overflows PHP_INT_MAX (sometime in 2038 for 32-bit builds), it will be converted to a double, AIUI. Won't it ?

@fgm Any int could overflow though, should every int then be documented as int|double?

I set plenty of int documented params to ints elsewhere without this complaint, so I assume it's a time() issue... So on a 64 bit system in the year 292,277,026,596 my int becomes a double and that's worth complaining about? I mean alright, 32 bit systems, which are all ready rare, we will need to worry about the 2038 bug, but I feel like 32 bit systems, let alone PHP will probably be out of style before then.