valitron icon indicating copy to clipboard operation
valitron copied to clipboard

bccomp(): bcmath function argument is not well-formed

Open dfrancesch opened this issue 3 years ago • 1 comments

Hi! I'm getting this error in vlucas\valitron\src\Valitron\Validator.php line 366 On Windows.

I think it's an issue with php version 7.4.18 (win), because on php 7.3.29 (linux) it doesn't happen.

dfrancesch avatar Aug 04 '21 21:08 dfrancesch

I've done a bit of reading and you're idea seems correct: https://www.php.net/manual/en/migration74.incompatible.php "BCMath functions will now warn if a non well-formed number is passed, such as "32foo". The argument will be interpreted as zero, as before." I think we need to make sure the number is well-formed before passing it to bcmath

willemwollebrants avatar Aug 10 '21 09:08 willemwollebrants