-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e164PhoneNumber() generates invalid US Phone Numbers #332
Comments
I'm not sure I understand, from my understanding phone numbers can start with a |
@RPJamie @bramceulemans According to Wikipedia, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions. |
@IonBazan this is a simple check and anyway the code is already in place. In protected static $e164Formats = [
'+1{{areaCode}}{{exchangeCode}}####',
]; None of the other en_US phone number formatters have this problem, just the e164 one. Happy to create a PR if needed to fix this one LOC. |
Summary
Using
e164PhoneNumber()
, an invalid number is created for en_US. The generated phone numbers that start with 0 or 1, are invalid.Versions
fakerphp/faker
Self-enclosed code snippet for reproduction
Example invalid number that was generated:
+16200858074
Tested using giggsey/libphonenumber-for-php library locally as well as the online version
https://giggsey.com/libphonenumber/index.php?phonenumber=%2B16200858074&country=US //Starting with 0
https://giggsey.com/libphonenumber/index.php?phonenumber=%2B16201858074&country=US //Starting with 1
both
isValidNumber()
andisValidNumberForRegion()
failThe text was updated successfully, but these errors were encountered: