Closed
Description
Hello,
I encountered weird behavior of PHP (in all versions) when base math operations are involved:
PHP Sandbox example
If result of this kind of math operation goes through integer validation, it fails, even if the Constraint::CHECK_MODE_COERCE_TYPES
flag is passed. It's because of how the toInteger($value)
conversion function works.
Second part of this condition is, in the mentioned case, evaluated as false:
if (is_numeric($value) && (int) $value == $value)
I will try to come up with PR, in the meantime I will use bcmath
functions.
Thank you for all the time and energy, which go to this project.
Metadata
Metadata
Assignees
Labels
No labels