This is a PHP library to implement A/B testing.
- Very generic setup of the library:
- Supports web applications.
- Supports console applications.
- Complete freedom in how to handle tests.
- Simply provide two callbacks that should be executed. One for your A-test and one for your B-test.
- Participation management
- Let people participate based on your own choices.
- Choose per test how to handle participants.
- Provides complete freedom, simply create a class that implements
PhpAb\Participation\Strategy\StrategyInterface.
- Identify users
- Provides a CookieStorage to store the choice in a cookie.
- Provides a SessionStorage to store the choice in the current session.
- Provides complete freedom, simply create a class that implements
PhpAb\Storage\StorageInterface.
- Analytics
- Recognizes existing visitors and new visitors.
- Provides complete freedom, simply create a class that implements
PhpAb\Analytics\AnalyticsInterface.
- Unit tested
This library runs on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7 and HHVM.
It's recommended to install this library via Composer.
{
"require": {
"phpab/phpab": "dev-master"
}
}The current master branch is considered stable. The badges on top of this document should confirm this.
Take a look at example/example.php for a complete example.


