Conversation
PHP keeps the sign of a negative remainder, so the tenth digit was -9 and the number was -98 instead of 18.
pwsdotru
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(7 * odd positions - even positions) mod 10. PHP keeps the sign of a negative remainder, so the digit was-9and the two check characters were the string-98.190909090checks as18. The full number19090909018was rejected.19090909019stays invalid. Existing vectors such as553006348/82and10000000146still pass.2.0. This pull request targets1.24, which is the branch current releases come from. Issue Issues with T.C. ID number generation: leading zero and negative tenth digit #966 described the negative digit and was closed by the stale bot without a code change.Test plan
vendor/bin/phpunit --filter PersonTest test/Faker/Provider/tr_TR/PersonTest.phpfailed on the new vector before the fix (expected '18', actual '-98', and19090909018was not valid)Made with Cursor