NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #3357 most downloaded on Packagist
Constraint class for international zipcode validation
Latest stable
v4.0.2
Last release 25 days ago
28 Oct 2026
Ships fairly regularly
a new release about every 5 months
Nearly every release is documented
notes for 34 of 36 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
36 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Thanks to @jcglombard, Hong Kong postal code validation now accepts common placeholder values when no formal postcode exists. The validator now accept
Hello Zipcode validators ;-)
Thanks to @jcglombard, Hong Kong postal code validation now accepts common placeholder values when no formal postcode exists. The validator now accepts 999077, 000, 0000, 000000, HKG, 00000, and HK for Hong Kong.
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v4.0.1...v4.0.2
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v4.0.2/README.md
Highlights: [IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/70 Accept Hong Kong postcode placeholders #69 by @jcglombard
Happy validating!
Thanks to @jcglombard Luxembourg postal codes now accept the official L-XXXX format in addition to four digits. Both 8211 and L-8211 are valid.
Hello Zipcode validators ;-)
Thanks to @jcglombard Luxembourg postal codes now accept the official L-XXXX format in addition to four digits. Both 8211 and L-8211 are valid.
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v4.0.0...v4.0.1
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v4.0.1/README.md
[IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/68 Allow optional L- prefix for Luxembourg postal codes #67 by @jcglombard
Happy validating!
Your coding agent can read these notes before it upgrades. Set up the MCP server →
It requires patched symfony/validator versions only (^5.4.43 || ^6.4.11 || ^7.1.4 || ^8.0) to address CVE-2024-50343 (GHSA-g3rh-rrhp-jhh9). If you sti…
Hello Zipcode validators ;-)
This v4.0.0 release is a security-focused update. It requires patched symfony/validator versions only (^5.4.43 || ^6.4.11 || ^7.1.4 || ^8.0) to address CVE-2024-50343 (GHSA-g3rh-rrhp-jhh9). If you still run Symfony Validator 4.x or unsupported 5.x / 6.x / 7.0.x lines, upgrade Symfony before updating this package.
We also pinned PHPUnit to patched releases in development (GHSA-qrr6-mg7r-m243), added composer.lock, and set config.platform.php so locks stay reproducible. CI was adjusted (e.g. prefer-lowest on Symfony 5.4; PHP 8.3 with Symfony 7.1). The ZipCode constraint was aligned with current Symfony Constraint behavior where needed.
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v3.2.0...v4.0.0 Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v4.0.0/README.md
[SECURITY] Require patched symfony/validator for CVE-2024-50343; CI updates; ZipCode constraint alignment with Symfony Validator
[SECURITY] Dev: PHPUnit patched versions; track composer.lock; config.platform.php for reproducible resolution
Happy validating!
Thanks to @Pixelshaped the Zipcode Validator is now ready for the future! 🚀 We added support for Symfony 8 and modernized the codebase to support PHP
Hello Zipcode validators ;-)
Thanks to @Pixelshaped the Zipcode Validator is now ready for the future! 🚀 We added support for Symfony 8 and modernized the codebase to support PHP 8 Attributes with Named Arguments. This makes your code even cleaner and more readable.
Example of the new syntax:
#[ZipCode(iso: 'DE')]
Don't worry, the old array syntax is still fully supported for backward compatibility!
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v3.1.5...v3.2.0 Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.2.0/README.md
[FEATURE] #66 Add Symfony 8 compatibility & Named Arguments support by @Pixelshaped
Happy validating!
Thanks to @damiansakwinski the Zipcode Validator now accepts NA- prefix for Namibia's postal codes as well as CU- prefix for Cuban postal codes. Aweso
Hello Zipcode validators ;-)
Thanks to @damiansakwinski the Zipcode Validator now accepts NA- prefix for Namibia's postal codes as well as CU- prefix for Cuban postal codes. Awesome!!!
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v3.1.4...v3.1.5
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.1.5/README.md
[IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/62 Add Cuba (CU) support #62 by @damiansakwinski [IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/63 Add support for Namibia (NA) #64 by @damiansakwinski
Happy validating!
Sorry for another minor fix... and thanks for that catch @dsbe-ak https://github.com/barbieswimcrew/zip-code-validator/pull/59#issuecomment-2527324391
Hello Zipcode validators ;-)
Sorry for another minor fix... and thanks for that catch @dsbe-ak https://github.com/barbieswimcrew/zip-code-validator/pull/59#issuecomment-2527324391
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator See changes: v3.1.3...v3.1.4
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.1.4/README.md
Highlights: [FIX] https://github.com/barbieswimcrew/zip-code-validator/pull/60 (@barbieswimcrew)
Happy validating!
This minor fixes the deprecation warning
Hello Zipcode validators ;-)
This minor fixes the deprecation warning
Deprecated: ZipCodeValidator\Constraints\ZipCode::__construct(): Implicitly marking parameter $groups as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/barbieswimcrew/zip-code-validator/src/ZipCodeValidator/Constraints/ZipCode.php on line 23
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator See changes: v3.1.2...v3.1.3
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.1.3/README.md
Highlights: [FIX] https://github.com/barbieswimcrew/zip-code-validator/pull/59 Fix "Implicitly marking parameter $groups as nullable is deprecated" (https://github.com/barbieswimcrew/zip-code-validator/pull/59) (@barbieswimcrew)
Happy validating!
Thanks to @Kuller86 the Zipcode Validator now accepts MD- prefix for Moldova's postal codes. Awesome!!!
Hello Zipcode validators ;-)
Thanks to @Kuller86 the Zipcode Validator now accepts MD- prefix for Moldova's postal codes. Awesome!!!
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v3.1.1...v3.1.2
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.1.2/README.md
[IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/55 Allow MD- prefix for Moldova postal codes (@Kuller86)
Happy validating!
Thanks to @Chris53897 effort, Zipcode Validator now relies on PHPUnit 11 as well as got testrun for PHP 8.3 and Symfony 7. Awesome!!!
Hello Zipcode validators ;-)
Thanks to @Chris53897 effort, Zipcode Validator now relies on PHPUnit 11 as well as got testrun for PHP 8.3 and Symfony 7. Awesome!!!
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v3.1.0...v3.1.1
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.1.1/README.md
[IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/52 chore: add testrun for PHP 8.3, symfony 7.0 (@Chris53897 ) [IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/53 chore: allow phpunit 11 (@Chris53897 )
Happy validating!
Thanks to @Chris53897 and @Pixelshaped for their contribution to this project. Thanks to their effort, Zipcode Validator can be used via Attributes fr
Hello Zipcode validators ;-)
Thanks to @Chris53897 and @Pixelshaped for their contribution to this project. Thanks to their effort, Zipcode Validator can be used via Attributes from now on and relies on PHPUnit 10! Isn't that great?
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v3.0.0...v3.1.0
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.1.0/README.md
Happy validating!
But please be aware that this might be some BREAKING CHANGE to your project.
Hi Zipcode-Validators! ;-)
Time marches on... With this release we dropped support for old PHP versions and adapt the code to the PHP 8+ realities and language features. Thanks to @Chris53897 for your help!
But please be aware that this might be some BREAKING CHANGE to your project.
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v2.0.1...v3.0.0
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v3.0.0/README.md
Happy validating!
Thanks to @Kuller86 the Zipcode Validator now accepts MD- prefix for Moldova's postal codes. Awesome!!!
Hello Zipcode validators ;-)
Thanks to @Kuller86 the Zipcode Validator now accepts MD- prefix for Moldova's postal codes. Awesome!!!
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v2.0.1...v2.0.2
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v2.0.2/README.md
[IMPROVEMENT] https://github.com/barbieswimcrew/zip-code-validator/pull/57 Allow MD- prefix for Moldova postal codes (#55) (@Kuller86)
Happy validating!
But please be aware that this might be some BREAKING CHANGE to your project.
Hi Zipcode-Validators! ;-)
This release fixes deprecation issues occurring in PHP 8.1. Many thanks to @GenieTim to get that solved!
But please be aware that this might be some BREAKING CHANGE to your project.
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v2.0.0...v2.0.1
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v2.0.1/README.md
Happy validating!
But please be aware that this might be some BREAKING CHANGE to your project.
Hi Zipcode-Validators! ;-)
This release resolves a somewhat illogical implementation into thin air. Due to a design flaw, the Zipcode Validator did cause some violation even for empty values. To handle that we implemented the "ignoreEmpty" option some time ago. But thanks to @rimas-kudelis this is now history!
But please be aware that this might be some BREAKING CHANGE to your project.
To upgrade run:
$ composer update barbieswimcrew/zip-code-validator
See changes: v1.3.6...v2.0.0
Documentation: https://github.com/barbieswimcrew/zip-code-validator/blob/v2.0.0/README.md
NotNull or NotBlank constraint in addition to ZipCode. (@rimas-kudelis)Happy validating!
Modify Lithuanian (LT) zipcode regex issues (rimas-kudelis)
Fix Jamaican (JA) zipcode regex issues (aschempp)
Thanks to Yanick the zip code regex pattern for Switzerland (CH) has been improved (Toflar)
Add zipcode regex for Jamaica JA as well as tests for JA (boxblinkracer)
Add zipcode regex for Panama PA as well as tests for PA (boxblinkracer)
Make ES zip code regexp more explicit (monro93)
The Mockery dependency has been replaced by PhpUnit (dangenendt)
[A-Z]{2}? shouldn't be optional in NL zip code (mwansinck)
Adding the ability to decide whether the validation should check case sensitive or not. This may be done via the new "caseSensitiveCheck" property. (n
Forcing a start and end string match for GB zipcode regex. (gonzalovilaseca)
Allowing the LV- part of an Latvian postcode to be optional (timwebsterreiss)
Allowing the second part of an Irish postcode to be optional (timwebsterreiss)
added regex patterns for Hong Kong (HK) and Macau (MO)
added new option "ignoreEmpty" (bool, default: false) that, set TRUE, avoids that validation fails if there is an empty value
Allowing A or B word character in FR pattern
Fixed regex for NL to allow optional space before letter suffix
Updated regex patterns for AI, AM, BB, BH, BM, BN, BR, CA, CZ, EC, FR, GB, GG, IM, JE, LB, LI, MT, MU, NG, NL, OM, PE, SE, SH, SK, SO, TW, TZ
Fixed a bug that occurred when using a getter in an entity's property annotation. By removing empty $constraint->iso check the validation now works pr
Fixed a bug that occurred when setting the iso code in lowercase (e.g. "de" instead of "DE"). Now lowercase iso codes will be converted to uppercase a
added support for new Korea postal code pattern
Nothing published for this version
Nothing published for this version
One column per quarter.