
Faker
A PHP library that generates realistic fake data like names, addresses, and text for testing.
- Stars
- 26.6k
- Forks
- 3.6k
- Licence
- MIT
- Language
- PHP
- Last update
- 2.6 years ago
- Type
- Library
This repository is archived and no longer maintained.
What it is
Faker is a PHP library that produces made-up but realistic-looking data, such as names, addresses, phone numbers, companies, lorem ipsum text, and dates. You call it from PHP code and it returns random values on each call. People use it to fill test databases, build sample XML documents, or stress-test storage, and the README also mentions anonymizing data taken from a production service. The project is archived and no longer maintained.
- Seed a development database with fake users, addresses, and companies using Faker\Factory::create()
- Generate sample text with lorem or realText for page layouts
- Produce random numbers, UUIDs, or colors for test fixtures
- Populate ORM or ODM entities with generated values, as the README's section on populating entities describes
Great for
- PHP developers who need sample data for tests or seeding a database
- Teams building demo or staging environments that need realistic-looking records
- Developers who want reproducible random data via seeding
- Anyone maintaining an existing PHP project that already depends on Faker
Not ideal for
- New projects that want active maintenance: the README says Faker is archived, so no further updates are expected
- Non-PHP stacks: it is a PHP library, and the README does not describe ports in other languages
- Projects needing real, verified personal data: the output is random and not meant to represent real people
How to get it
- 1
Install with a package manager
You'll need: PHP >= 5.3.3 · Composer
Install via Composer
composer require fzaninotto/faker - 2
Run it
- Install the package with Composer using the command above.
- Require vendor/autoload.php in your PHP script.
- Create a generator with $faker = Faker\Factory::create();
- Print values such as $faker->name or $faker->address.
- 3
Get the most out of it
- Use seeding to get repeatable output across test runs, as the README's Seeding the Generator section covers
- Use locale-specific formatters via the Localization section if you need data outside the default locale
- Use the Modifiers section to change how formatters behave, such as unique values
- Use Populating Entities Using an ORM or an ODM to fill model objects directly
Downloads
Strengths
- Simple API: access properties like $faker->name and get a new random value each time
- Wide built-in coverage of formatters, including person, address, company, date, and internet data
- Seeding support makes generated data repeatable for tests
Trade-offs
- Archived project, so it will not receive new features or fixes from upstream
- Requires PHP 5.3.3 or later per the README, which is an old minimum and may not match modern PHP setups
- Bundled localized formatters are described in the README mainly for en_US
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.