If a number such a 4111111111111111 (should pass) or 4111111111111119 (should fail) is passed to the Luhn validation prop, the result is an invalidartumentexception is thrown. This is because the above numbers exceed the maximum size for integers on 32 bit builds of PHP and get converted to float.
If the prop is modified to accept floats, both of the examples above get treated as 4.1111111111111E+15, which are indistinguishable, and the number that should fail (the one ending in 9) actually ended up being passed as valid.
Seeing as typical credit card numbers are 16-20 digits long, and the Luhn check is most typically used as a sanity check on credit card numbers, this is a problem
If a number such a 4111111111111111 (should pass) or 4111111111111119 (should fail) is passed to the Luhn validation prop, the result is an invalidartumentexception is thrown. This is because the above numbers exceed the maximum size for integers on 32 bit builds of PHP and get converted to float.
If the prop is modified to accept floats, both of the examples above get treated as 4.1111111111111E+15, which are indistinguishable, and the number that should fail (the one ending in 9) actually ended up being passed as valid.
Seeing as typical credit card numbers are 16-20 digits long, and the Luhn check is most typically used as a sanity check on credit card numbers, this is a problem
This doesn't happen on 64 bit builds.