r/webdev • • 15h ago

Showoff Saturday Standard identifiers for PHP

https://php-stdnum.org/

Over... many months, I've been working on php-stdnum, a PHP library for handling standard identifiers: VAT numbers, tax identifiers, IBANs, national identifiers, company registration numbers, ISBNs, postal codes and others.

It now supports 606 identifier types and includes 594 generators for reproducible test data.

There are no mandatory third-party Composer dependencies, but optional integrations with Laravel, Symfony, Doctrine and FakerPHP.

In benchmarks, direct validation of selected identifiers took 1–5.2 µs per call, with German VAT validation adding approximately 0.11 MiB of process memory. For details see php-stdnum.org/library/docs/guide/performance.html

Tested on PHP 8.3–8.6.

Documentation: php-stdnum.org

GitHub: github.com/php-stdnum/php-stdnum

9 Upvotes

6 comments sorted by

0

u/[deleted] 13h ago

[removed] — view removed comment

2

u/Worried_Librarian_79 12h ago

Each country has its own implementation. Its rules can be updated independently. But the changes are distributed through a new release, so validation behavior doesn't change unexpectedly without a dependency update.

1

u/webdev-ModTeam 1h ago

Your post/comment has been determined to be a low-effort post or comment. This includes title-only posts, easily searchable questions, vague/open-ended discussion prompts, LLM generated posts or comments, and posts/comments that do not provide enough context for meaningful replies or discussion.