PHPackages                             configcat/configcat-client-php7 - 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. configcat/configcat-client-php7

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

configcat/configcat-client-php7
===============================

ConfigCat SDK for PHP 7. ConfigCat is a feature flag, feature toggle, and configuration management service. That lets you launch new features and change your software configuration remotely without actually (re)deploying code. ConfigCat even helps you do controlled roll-outs like canary releases and blue-green deployments.

v3.1.0(5mo ago)499.5k↓45.9%[3 PRs](https://github.com/configcat/php7-sdk/pulls)MITPHPPHP &gt;=7.2CI passing

Since Mar 9Pushed 4d ago4 watchersCompare

[ Source](https://github.com/configcat/php7-sdk)[ Packagist](https://packagist.org/packages/configcat/configcat-client-php7)[ Docs](https://github.com/configcat/php7-sdk)[ RSS](/packages/configcat-configcat-client-php7/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (10)Versions (16)Used By (0)

ConfigCat SDK for PHP 7
=======================

[](#configcat-sdk-for-php-7)

ConfigCat SDK for PHP 7 provides easy integration for your application to ConfigCat.

ConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using [ConfigCat Dashboard](https://app.configcat.com) even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.

ConfigCat is a [hosted feature flag service](https://configcat.com). Manage feature toggles across frontend, backend, mobile, desktop apps. [Alternative to LaunchDarkly](https://configcat.com). Management app + feature flag SDKs.

[![Build Status](https://github.com/configcat/php7-sdk/actions/workflows/php-ci.yml/badge.svg?branch=main)](https://github.com/configcat/php7-sdk/actions/workflows/php-ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/5835fc844b11ba63d99807b325d2d009aa41376af9a2f90e95305d463ed404b2/68747470733a2f2f706f7365722e707567782e6f72672f636f6e6669676361742f636f6e6669676361742d636c69656e742d706870372f76657273696f6e)](https://packagist.org/packages/configcat/configcat-client-php7)[![Total Downloads](https://camo.githubusercontent.com/101086c076e53160a7ecce3eab80728ddddfada32a34369f9274a1c281a3a111/68747470733a2f2f706f7365722e707567782e6f72672f636f6e6669676361742f636f6e6669676361742d636c69656e742d706870372f646f776e6c6f616473)](https://packagist.org/packages/configcat/configcat-client-php7)[![Sonar Quality Gate](https://camo.githubusercontent.com/779464ffb6624eb6a3e606e10888547c1a5f8c8d60062fbc8bfa6602167e05f9/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f7175616c6974795f676174652f636f6e6669676361745f706870372d73646b3f6c6f676f3d736f6e6172636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/overview?id=configcat_php7-sdk)[![Sonar Coverage](https://camo.githubusercontent.com/ba74149696f7fbb479bb92a525633d54df9d44a2df009d0e5f7fd14a86f333de/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f636f6e6669676361745f706870372d73646b3f6c6f676f3d536f6e6172436c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/overview?id=configcat_php7-sdk)

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2

ConfigCat SDK for PHP &gt;= 8.1 is available [here](https://github.com/configcat/php-sdk).

Getting started
---------------

[](#getting-started)

### 1. Install the package with [Composer](https://getcomposer.org/)

[](#1-install-the-package-with-composer)

```
composer require configcat/configcat-client-php7
```

### 2. Go to the [ConfigCat Dashboard](https://app.configcat.com/sdkkey) to get your *SDK Key*:

[](#2-go-to-the-configcat-dashboard-to-get-your-sdk-key)

[![SDK-KEY](https://raw.githubusercontent.com/ConfigCat/php7-sdk/main/media/readme02-3.png "SDK-KEY")](https://raw.githubusercontent.com/ConfigCat/php7-sdk/main/media/readme02-3.png)

### 3. Create the *ConfigCat* client instance

[](#3-create-the-configcat-client-instance)

```
$client = new \ConfigCat\ConfigCatClient("#YOUR-SDK-KEY#");
```

### 4. Get your setting value:

[](#4-get-your-setting-value)

```
$isMyAwesomeFeatureEnabled = $client->getValue("isMyAwesomeFeatureEnabled", false);
if(is_bool($isMyAwesomeFeatureEnabled) && $isMyAwesomeFeatureEnabled) {
    doTheNewThing();
} else {
    doTheOldThing();
}
```

Getting user specific setting values with Targeting
---------------------------------------------------

[](#getting-user-specific-setting-values-with-targeting)

Using this feature, you will be able to get different setting values for different users in your application by passing a `User Object` to the `getValue()` function.

Read more about [Targeting here](https://configcat.com/docs/advanced/targeting/).

User object
-----------

[](#user-object)

Percentage and targeted rollouts are calculated by the user object you can optionally pass to the configuration requests. The user object must be created with a **mandatory** identifier parameter which should uniquely identify each user:

```
$user = new \ConfigCat\User("#USER-IDENTIFIER#"); // mandatory

$isMyAwesomeFeatureEnabled = $client->getValue("isMyAwesomeFeatureEnabled", false, $user);
if(is_bool($isMyAwesomeFeatureEnabled) && $isMyAwesomeFeatureEnabled) {
    doTheNewThing();
} else {
    doTheOldThing();
}
```

Sample/Demo app
---------------

[](#sampledemo-app)

- [Sample Laravel app](https://github.com/ConfigCat/php7-sdk/tree/main/samples/laravel)

Need help?
----------

[](#need-help)

Contributing
------------

[](#contributing)

Contributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).

About ConfigCat
---------------

[](#about-configcat)

- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)
- [Documentation](https://configcat.com/docs)
- [Blog](https://configcat.com/blog)

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance87

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~210 days

Total

11

Last Release

165d ago

Major Versions

v1.1.1 → v2.0.02023-09-12

v2.1.1 → v3.0.02024-03-25

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v3.1.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1aafa26aa2864048c7a1d3f0c284fc6f438ef1bd05c7d87402562ad943fe4b29?d=identicon)[configcat](/maintainers/configcat)

---

Top Contributors

[![z4kn4fein](https://avatars.githubusercontent.com/u/13772020?v=4)](https://github.com/z4kn4fein "z4kn4fein (31 commits)")[![adams85](https://avatars.githubusercontent.com/u/31276480?v=4)](https://github.com/adams85 "adams85 (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

feature togglefeature flagconfigcatuser targeting

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/configcat-configcat-client-php7/health.svg)

```
[![Health](https://phpackages.com/badges/configcat-configcat-client-php7/health.svg)](https://phpackages.com/packages/configcat-configcat-client-php7)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
