NewYour coding agent can read the release notes before it upgrades.Set up the MCP server โ
Packagist
Packagist, #3367 most downloaded on Packagist
A library to format and validate postcodes
Latest stable
0.7.0
Last release 11 days ago
11 Nov 2026
Release timing varies
gaps range from 2 weeks to 12 months
Nearly every release is documented
notes for 22 of 23 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
23 releases ยท first in 2017
Drag across the ruler to compare, or tap a release to open it.
Vietnam postcodes now accept 5 digits instead of 6 digits
๐ฅ Breaking changes
Add support for Nigeria's 11-character postcodes (#25 by @Adeniyikayodee)
โจ New features
Your coding agent can read these notes before it upgrades. Set up the MCP server โ
Allow postcodes above 984 99 in Sweden (#24 by @cx18121)
๐ Bug fixes
984 99 in Sweden (#24 by @cx18121)Support for 4-digit postcodes in Lebanon (LB)
โจ Improvements
Exceptions have been moved to Brick\Postcode\Exception
๐ฅ Breaking changes
8.2Brick\Postcode\Exceptionโจ New features
PostcodeException classโจ Improvements
RuntimeException๐ฅ Breaking changes - Minimum PHP version is now 8.1
๐ฅ Breaking changes
8.1Netherlands postcodes cannot start with 0 (#18) - thanks to @RoodFruit
โจ Improvements
0 (#18) - thanks to @RoodFruitInvalidPostcodeException now has getPostcode() and getCountry() methods
๐ฅ Breaking changes
finalโจ New features
InvalidPostcodeException now has getPostcode() and getCountry() methods (#13)UnknownCountryException now has a getCountry() method (#13)โจ Improvements
AT, BE and LU formatters now accept (and strip) a leading A/ B/L letter (#13)Thanks to @ruben9227!
Exclude Austrian postal codes starting with 0 (#15) - thanks to @weswaldix
โจ Improvements
0 (#15) - thanks to @weswaldixSupport for 7-digit postal codes in Egypt (#14) - thanks to @faustbrian
โจ New features
Formatter for IC (Canary Islands) (#12) - thanks to @mpesari
โจ New features
IC (Canary Islands) (#12) - thanks to @mpesariMinimum PHP version is now 7.4. No breaking changes.
Minimum PHP version is now 7.4. No breaking changes.
Fix CO formatter (#11) - thanks to @strotgen
๐ Bug fix
Fix GB formatter not accepting C in inward code (#9) - thanks to @chris-ware
๐ Bug fix
C in inward code (#9) - thanks to @chris-wareFurther improvements to the IE formatter (#8) - thanks to @wernerwa
๐ Bug fix
Fixed the IE formatter not accepting the ANN ANNN format (#7) - thanks to @nigobo
๐ Bug fix
IE formatter not accepting the ANN ANNN format (#7) - thanks to @nigoboFixed the SE formatter that was missing space (#6) - thanks to @grizzm0
๐ Bug fix
SE formatter that was missing space (#6) - thanks to @grizzm0๐ Improvements to the `GB` validator
๐ Improvements to the GB validator
GIR 0AAThanks to @jamiethompson!
๐ฅ Removed dependency
The library had an undocumented dependency on ext-ctype, which has been removed with an internal refactoring.
โจ New method: isSupportedCountry().
โจ New method: isSupportedCountry().
Thanks to @VictorDauchy!
PostcodeFormatter now checks the syntax of the country code before calling class_exists(). This will circumvent any attempt to abuse class_exists() if
๐ Code improvements
PostcodeFormatter now checks the syntax of the country code before calling class_exists(). This will circumvent any attempt to abuse class_exists() if any security issues ever affect it.๐ Package improvements
--no-dev, the autoloader does not autoload tests anymoreThis will help make installations more compact.
๐ฅ Breaking changes in `PostcodeFormatter`
โจ All countries are now supported!
๐ฅ Breaking changes in PostcodeFormatter
formatPostcode() has been renamed to format().isValidPostcode() has been removed; the rationale behind this is that one should not just validate a postcode, but replace it with its formatted counterpart as well.$cleanup parameter has been removed from format(). The postcode is now always cleaned up, but only from possible separators: spaces and dashes.๐ฅ Other changes
Formatter, to prevent PHP syntax errors for some country codes.Country codes are now case-insensitive.
Country codes are now case-insensitive.
Nothing published for this version
One column per quarter.