PHPackages                             beastbytes/phone-number-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. beastbytes/phone-number-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

beastbytes/phone-number-validator
=================================

National and international phone number validator

2.0.0(1y ago)2111BSD-3-ClausePHPPHP ^8.1

Since Jun 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/beastbytes/phone-number-validator)[ Packagist](https://packagist.org/packages/beastbytes/phone-number-validator)[ RSS](/packages/beastbytes-phone-number-validator/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (10)Versions (3)Used By (0)

Phone Number Validator (phone-number-validator)
===============================================

[](#phone-number-validator-phone-number-validator)

Provides validation for national and international phone numbers.

**NOTE:** phone-number-validator does ***not*** guarantee that a phone number exists, just that it is in a valid format.

International Phone Numbers
---------------------------

[](#international-phone-numbers)

International phone numbers are validated against the [Extensible Provisioning Protocol (EPP)](https://www.rfc-editor.org/rfc/rfc4933.html#section-2.5) and/or [ITU-T Recommendation E.123 (“Notation for national and i11l telephone numbers, e-mail addresses and Web addresses”)](https://www.itu.int/rec/T-REC-E.123) and [ITU-T Recommendation E.164 (“The international public telecommunication numbering plan”)](https://www.itu.int/rec/T-REC-E.164) formats.

**Note:** EPP formatted phone numbers are valid ITU phone numbers.

National Phone Numbers
----------------------

[](#national-phone-numbers)

To validate national phone numbers a N6lPhoneNumberDataInterface implementation is required, e.g. beastbytes/n6l-phone-number-data-php which provides all numbering plans in the [ITU T0202 National Numbering Plans](https://www.itu.int/oth/T0202.aspx?parent=T0202)

National phone numbers are validated against country specific formats; they can be validated against a single country, a subset of, or all countries provided by the N6lPhoneNumberDataInterface implementation.

License
-------

[](#license)

For license information see the [LICENSE](LICENSE.md) file.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist beastbytes/phone-number-validator

```

or add

```
"beastbytes/phone-number-validator": "^1.0.0"
```

to the 'require' section of your composer.json.

Unit testing
------------

[](#unit-testing)

The package is tested with [PHPUnit](https://phpunit.de/). To run tests:

```
./vendor/bin/phpunit
```

Mutation testing
----------------

[](#mutation-testing)

The package tests are checked with [Infection](https://infection.github.io/) mutation framework with [Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:

```
./vendor/bin/roave-infection-static-analysis-plugin
```

Static analysis
---------------

[](#static-analysis)

The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:

```
./vendor/bin/psalm
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~464 days

Total

2

Last Release

639d ago

Major Versions

v1.0.0 → 2.0.02024-10-02

PHP version history (2 changes)v1.0.0PHP ^8.0

2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0b5133b5137b26eeb25056449c28364ac0af31836eefba78912a9c8f0743aa3?d=identicon)[BeastBytes](/maintainers/BeastBytes)

---

Top Contributors

[![beastbytes](https://avatars.githubusercontent.com/u/1470144?v=4)](https://github.com/beastbytes "beastbytes (15 commits)")

---

Tags

eppitu-e123itu-e164itu-t0202phone-numbervalidatoryii3validatorphone-numbereppE164itu-tituE.123

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/beastbytes-phone-number-validator/health.svg)

```
[![Health](https://phpackages.com/badges/beastbytes-phone-number-validator/health.svg)](https://phpackages.com/packages/beastbytes-phone-number-validator)
```

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

6.0k39.9M415](/packages/respect-validation)[seld/jsonlint

JSON Linter

1.3k228.7M270](/packages/seld-jsonlint)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k193.5M40](/packages/composer-spdx-licenses)[ronanguilloux/isocodes

PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book and Music Industries, Phone numbers &amp; Zipcodes for many countries

8123.5M27](/packages/ronanguilloux-isocodes)[opis/json-schema

Json Schema Validator for PHP

65243.6M302](/packages/opis-json-schema)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15848.2M222](/packages/laminas-laminas-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
