Download the PHP package byrokrat/id without Composer

On this page you can find all versions of the php package byrokrat/id. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.


After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package id

Personal Identity

Packagist Version Build Status Quality Score

Data types for swedish personal identity and corporation id numbers.



Class hierarchy

Creating ID objects

Creating ID objects can be complicated.

To solve these difficulties a decoratable set of factories is included. Create a factory with the abilities you need by chaining factory objects at creation time.

In this example the factory will first try to create a PersonalId, if this fails it will try to create a CoordinationId, if this fails it will throw an Exception.

The following factories are included:

Controlling the delimiter and century of ids containing dates

In order to controll the computation of dates you may specify at what time parsing takes place by passing a datetime object.

Specifying parse date also affects what delimiter is used.


Ids can be printed in custom formats using the format() method, where $formatStr is a mix of format tokens and non-formatting characters (for a list of formatting tokens se below).

If you need to format a large number of ids a formatter object can be created.

Formatting tokens

Characters that are not formatting tokens are returned as they are by the formatter.

Token Description
C Century, 2 digits (00 if not applicable)
S Part of serial number before delimiter, 6 digits
- Date and control string delimiter (- or +)
s Part of serial number after delimiter, 3 digits
k Check digit
X Sex, F, M or O (empty if not applicable)
L Legal form (empty if not applicable)
B Birth county (empty if not applicable)
\ Escape the following character
The following tokens are only valid for ids containing a date
A Current age
Y A full numeric representation of a year, 4 digits
y A two digit representation of a year
m Numeric representation of a month, with leading zeros, 2 digits
n Numeric representation of a month, without leading zeros, 1 through 12
F A full textual representation of a month, such as January or March
M A short textual representation of a month, three letters, Jan through Dec
t Number of days in the given month 28 through 31
W ISO-8601 week number of year, weeks starting on Monday
d Day of the month, 2 digits with leading zeros
j Day of the month without leading zeros, 1 to 31
l (lowercase 'L') A full textual representation of the day of the week
D A textual representation of a day, three letters Mon through Sun
w Numeric representation of the day of the week 0 (for Sunday) through 6
N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7
z The day of the year (starting from 0), 0 through 365


Swedish sources on the construction and usage of id numbers:

Symfony Bundle

To use as validation rules in your Symfony project see the third party package IdentityNumberValidatorBundle.

All versions of id with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package byrokrat/id contains the following files

Loading the files please wait ....