laruence · GitHub

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting floats and their notation (scientific) would make PHP more consistent. We currently support this for long parameters in argument parsing, e.g.

$ php -r 'var_dump(intdiv("1e3", 1));'
int(1000)

Yet due to the use of strtol() here, we don't for the integer operators, nor for (int) and intval(). So this means that 3e3 is considered to be 3 for some integer operations and 3000 for others, which is not ideal.

Would it cause backwards-compatibility issues if we started allowing floats here? I don't think it would.

Read the original on github.com ↗