Skip to content

e164PhoneNumber() generates invalid US Phone Numbers #332

@RPJamie

Description

@RPJamie

Summary

Using e164PhoneNumber(), an invalid number is created for en_US. The generated phone numbers that start with 0 or 1, are invalid.

Versions

Version
PHP 8.0
fakerphp/faker 1.14.1

Self-enclosed code snippet for reproduction

 $faker = FakerFactory::create();

dump($faker->e164PhoneNumber());

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() and isValidNumberForRegion() fail

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions