PHPackages                             optimizely/optimizely-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. optimizely/optimizely-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

optimizely/optimizely-sdk
=========================

Optimizely PHP SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts

4.0.2(1y ago)191.8M↓13.9%32[2 issues](https://github.com/optimizely/php-sdk/issues)[1 PRs](https://github.com/optimizely/php-sdk/pulls)1Apache-2.0PHPPHP &gt;=8.1

Since Nov 28Pushed 2mo ago100 watchersCompare

[ Source](https://github.com/optimizely/php-sdk)[ Packagist](https://packagist.org/packages/optimizely/optimizely-sdk)[ RSS](/packages/optimizely-optimizely-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (67)Used By (1)

Optimizely PHP SDK
==================

[](#optimizely-php-sdk)

[![Packagist](https://camo.githubusercontent.com/3793c0cc03c0c4ccd71991f16debfd79e12724b69bd397a189972689d9810460/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f6f7074696d697a656c792f6f7074696d697a656c792d73646b)](https://packagist.org/packages/optimizely/optimizely-sdk)[![Build Status](https://github.com/optimizely/php-sdk/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/optimizely/php-sdk/actions/workflows/php.yml?query=branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/8abc7f5f07af8261b94c14299e4ddcea96a3f5d9548a9d6b090b1e6ebd00dc50/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f7074696d697a656c792f7068702d73646b2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/optimizely/php-sdk?branch=master)[![Total Downloads](https://camo.githubusercontent.com/a93aa11333d8a40f7e1e02d009e8717d3dbbeb7eb11a79d7be1cf303c53c4a8b/68747470733a2f2f706f7365722e707567782e6f72672f6f7074696d697a656c792f6f7074696d697a656c792d73646b2f646f776e6c6f616473)](https://packagist.org/packages/optimizely/optimizely-sdk)[![Apache 2.0](https://camo.githubusercontent.com/7431fbd843a9b4d494723eabad361bee3d30232929d02a7126a30dd99c4655ff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6562756c612d706c7567696e732f677261646c652d65787472612d636f6e66696775726174696f6e732d706c7567696e2e737667)](http://www.apache.org/licenses/LICENSE-2.0)

This repository houses the PHP SDK for use with Optimizely Feature Experimentation and Optimizely Full Stack (legacy).

Optimizely Feature Experimentation is an A/B testing and feature management tool for product development teams that enables you to experiment at every step. Using Optimizely Feature Experimentation allows for every feature on your roadmap to be an opportunity to discover hidden insights. Learn more at [Optimizely.com](https://www.optimizely.com/products/experiment/feature-experimentation/), or see the [developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/welcome).

Optimizely Rollouts is [free feature flags](https://www.optimizely.com/free-feature-flagging/) for development teams. You can easily roll out and roll back features in any application without code deploys, mitigating risk for every feature on your roadmap.

Get Started
-----------

[](#get-started)

Refer to the [PHP SDK's developer documentation](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/php-sdk) for detailed instructions on getting started with using the SDK.

### Requirements

[](#requirements)

To access the Feature Management configuration in the Optimizely dashboard, please contact your Optimizely account executive.

SDK version 4.0.0 requires PHP8+. SDK version 3 requires PHP5.5+ up to PHP7.

### Install the SDK

[](#install-the-sdk)

The Optimizely PHP SDK can be installed through [Composer](https://getcomposer.org/). Please use the following command:

```
php composer.phar require optimizely/optimizely-sdk
```

Use the PHP SDK
---------------

[](#use-the-php-sdk)

### Initialization

[](#initialization)

Create the Optimizely client, for example:

```
