Obiekt PESEL, możliwość: walidacji, ustawienie zakresu roku poprawnych peseli, wyciągnięcia danych jakie znajdują się data urodzenia, płeć

1.0.0 2017-10-30 21:13 UTC


Object Pesel PESEL mean Personal Identificator for Poland

Build Status

Getting Started

Used this object for everytime when your project has number PESEL and you must valiadtion it.


PHP >= 7.1


Go to your project directory where the composer.json file is located and type:

composer install tomasz-kr/pesel

Running the tests

phpunit --configuration phpunit.xml 


Firstly, create object Pesel and add in constructor number Pesel:

$pesel = new PESEL("NUMBER");

Now, you can take information about:

  • Correct format
$pesel->isCorrectLenght(); //boolean
  • Correct only number
$pesel->isCorrectNumber(); //boolean
  • Correct for number controls
$pesel->valid(); //boolean
  • Correct for exist in this day
  • Correct for all condition
$pesel->isCorrect(); //boolean
  • Birthday
  • Gender
$pesel->whatGender(); //return man or woman
  • Correct year between 2 years (min and max)
$pesel->isCorrectYear(); //boolean


Min has 1st January 1800

Max has this days

  • Set max year
$pesel->setManYear(\DateTime $dateTime);
  • Set min year
$pesel->setMinYear(\DateTime $dateTime);


Tomasz Król


This project is licensed under the MIT License - see the LICENSE file for details