Download the PHP package divineomega/php-bucket-testing without Composer
On this page you can find all versions of the php package divineomega/php-bucket-testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download divineomega/php-bucket-testing
More information about divineomega/php-bucket-testing
Files in divineomega/php-bucket-testing
Package php-bucket-testing
Short Description This library enables developers to easily redirect users to different URLs, for the purpose of bucket testing. Bucket testing is also known as A/B testing or split testing. This type of testing is used to test two or more versions of a webpage to determine which one performs better based on specified key metrics, such as clicks, downloads, purchases or any other form of conversion.
License LGPL-3.0-only
Informations about the package php-bucket-testing
PHP Bucket Testing
This library enables developers to easily redirect users to different URLs, for the purpose of bucket testing. Bucket testing is also known as A/B testing or split testing.
This type of testing is used to test two or more versions of a webpage to determine which one performs better based on specified key metrics, such as clicks, downloads, purchases or any other form of conversion.
Features
- Random selection of buckets, with optional weights
- Stable weighted assignment for a user, account, or session identifier
- Automatic handling of temporary redirects
- Ability to retrieve bucket and manually handle URL redirection
- Injectable random-number generation for reproducible tests
- Easy to use fluent interface syntax
Installation
To install, just run the following composer command.
composer require jord-jd/php-bucket-testing
Remember to include the vendor/autoload.php file if your framework does not already do so.
Usage
Stable experiment assignments
For a meaningful A/B test, the same subject should normally stay in the same
cohort. Pass a stable, non-empty identifier such as a user ID, account ID, or
session ID to getBucketForSubject():
The assignment is deterministic and respects the configured weights. It does not require server-side storage, but changing the bucket list, its order, or its weights can change existing assignments.
Deterministic tests
You may inject a callable that returns an integer within the requested range.
Production code uses random_int() when available and falls back to mt_rand()
on older PHP versions.
Bucket URLs may be absolute or relative, but must be non-empty strings and may
not contain carriage-return or newline characters. redirect() accepts only
integer HTTP status codes from 300 through 399.
Compatibility
PHP 5.4 through the current PHP 8.x releases are supported. PHP 5.4 is the minimum because the package source has always used short-array syntax.
Upgrading to 4.0
Composer now enforces the real PHP 5.4 syntax minimum instead of incorrectly
advertising PHP 5.3 support. Bucket also rejects empty, non-string, or
header-unsafe URL values when constructed. Existing valid bucket URLs and the
original random-selection API continue to work unchanged.
All versions of php-bucket-testing with dependencies
ext-hash Version *