PHPackages                             feature/feature - 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. feature/feature

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

feature/feature
===============

v0.2.0(12y ago)215MITPHP

Since Feb 12Pushed 12y ago1 watchersCompare

[ Source](https://github.com/rmasters/feature)[ Packagist](https://packagist.org/packages/feature/feature)[ RSS](/packages/feature-feature/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (5)Used By (0)

feature/feature [![Build status](https://camo.githubusercontent.com/fb61628f01922f4cb3cebaa103a40cbb60b6ed40b71e1eafa75bb03bc3f54e32/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f726d6173746572732f666561747572652e737667)](https://travis-ci.org/rmasters/feature) [![Coverage Status](https://camo.githubusercontent.com/7a2da0366fd2efc9f6aef556e1be37ab61a1609bce4c6cc77b79aa7281a9ddca/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f726d6173746572732f666561747572652e737667)](https://coveralls.io/r/rmasters/feature)
=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#featurefeature--)

A simple feature-flag API that can be used for toggling functionality.

Usage
-----

[](#usage)

```
$features = new FeatureManager;

$features->setUser(new User(['id' => 1]));

$features->enable('new_calendar', function(Feature\User $user) {
    return in_array($user->id, [1, 2, 5]);
});

if ($features->can('new_calendar')) {
    // ...
}

```

Enable features by adding toggles that inspect attributes of the current user. Toggles can be as simple as a closure or any instance that implements [Toggle](src/Toggle.php).

Storage
-------

[](#storage)

Feature toggles can be defined in three ways:

- Direct PHP - as above,
- a structured array,
- or from a database.

Closures are supported by PHP and arrays in PHP (i.e. not from YAML etc.) Files and database require the toggle definitions to be pre-defined.

### Structured array

[](#structured-array)

```
$featureToggles = [
    // Feature name
    'view_calendar' => [
        // Each toggle with it's class name and constructor arguments
        ['name' => 'Feature\Toggles\IPWhitelist', 'params' => ['127.0.0.1']],

        // or a closure
        function(Feature\User $user) {
            return $user->id % 3 == 0;
        },

        // or a Toggle instance
        new Feature\Toggles\IPWhitelist(['192.168.0.1', '192.168.0.2']),
    ]
];

$features = new FeatureManager;
$storage = new Feature\Storage\Structured($features, $featureToggles);
$storage->load();

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

4475d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32d44b8b36e16d8e06b489556da46a1e839726b0d6003fcd2642a3c94c8069f7?d=identicon)[rmasters](/maintainers/rmasters)

---

Top Contributors

[![rmasters](https://avatars.githubusercontent.com/u/34284?v=4)](https://github.com/rmasters "rmasters (19 commits)")

---

Tags

featureflagtoggle

### Embed Badge

![Health badge](/badges/feature-feature/health.svg)

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

###  Alternatives

[opensoft/rollout

Feature switches or flags for PHP

2571.8M5](/packages/opensoft-rollout)[zumba/swivel

Strategy driven feature toggles

209135.7k5](/packages/zumba-swivel)[qandidate/toggle

Feature toggling for your PHP application.

3812.0M9](/packages/qandidate-toggle)[francescomalatesta/laravel-feature

A simple package to manage feature flagging in a Laravel project.

211206.4k](/packages/francescomalatesta-laravel-feature)[flagception/flagception-bundle

Feature toggle bundle on steroids.

283.8M](/packages/flagception-flagception-bundle)[ajgarlag/feature-flag-bundle

Provides a feature flag mechanism

1417.8k](/packages/ajgarlag-feature-flag-bundle)

PHPackages © 2026

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