krak/ab

A/B Testing Library

Maintainers

Details

github.com/krakphp/ab

Source

Issues

Installs: 76

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/krak/ab

v0.1.0 2016-12-19 04:44 UTC

This package is auto-updated.

Last update: 2025-09-18 20:04:35 UTC


README

Krak\AB is a framework for implementing AB Tests.

Installation

Install with composer at krak/ab

Usage

<?php

use Krak\AB;

$exp = AB\Experiment::create('flow', [
    // first is the variant name, second is the ratio.
    ['standard', 80],
    ['variant', 20],
]);

$engine = AB\engine([$exp], new Logger()); // any PSR Logger will work
// The default engine is the Hashing engine

foreach (range(1, 10) as $i) {
    //
    echo $engine->activate('flow', 'id_'.$i.rand()) . PHP_EOL;
}