You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@StratilJakub in an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful.
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 thetoInteger($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.
The text was updated successfully, but these errors were encountered: