# phpspec

> Specification-oriented BDD framework for PHP

Source: https://talira.ai/catalog/phpspec-k1mjredm
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Framework, Command-line tool
- Categories: [developer tools / testing / frameworks](https://talira.ai/categories/developer-tools/testing/frameworks)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [phpspec](https://talira.ai/orgs/phpspec-project.md)

phpspec is a specification-oriented behaviour-driven development framework for PHP 8.3 and later: you describe how a class should behave in specs, and phpspec drives its design and can generate the code. Version 9 is a complete rewrite that replaces the ObjectBehavior base class with a closure-based DSL inspired by RSpec and Jasmine, and adds a pair programming mode in which an LLM writes specs, generates code and refactors, driven by your specifications.

## Links

- Website: https://phpspec.net/
- GitHub: https://github.com/phpspec/phpspec
- Docs: https://phpspec.net/

## Problems it solves

- write behaviour-driven specs for my PHP classes before the code
- let my PHP specs drive the design and generate class skeletons
- an RSpec-style testing framework for PHP

## Features

- specification-oriented BDD
- code generation from specs
- closure-based DSL inspired by RSpec and Jasmine (v9)
- AI pair programming mode

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.46, adoption 0.66, momentum 0.32, community 0.90, backing 0.30, extensibility 0.00.

- last commit 43 days ago
- 1 commits in the last 90 days
- latest release 9.0.0-rc.10 13 days ago
- 1.9k GitHub stars
- 179 contributors
- has a company behind it

## Alternatives

- [Behat](https://talira.ai/catalog/behat-ywjzeqm5.md): Behaviour-driven development for PHP
- [Pest](https://talira.ai/catalog/pest-prkx0461.md): The elegant PHP testing framework
- [PHPUnit](https://talira.ai/catalog/phpunit-bg1qx6g0.md): The testing framework for PHP
- [Codeception](https://talira.ai/catalog/codeception-c3m740wg.md): Full-stack testing framework for PHP

## Sources

[^1]: https://github.com/phpspec/phpspec/blob/main/LICENSE (checked 27 Nov 2026)
