PHPackages                             phant/env - 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. phant/env

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

phant/env
=========

Manage env easily

1.0(3y ago)07MITPHPPHP &gt;=8.1

Since Oct 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/PhantPHP/env)[ Packagist](https://packagist.org/packages/phant/env)[ RSS](/packages/phant-env/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Env
===

[](#env)

Presentation
------------

[](#presentation)

The environment variable manager makes it easy to manipulate your environment variables in your projects.

Installation
------------

[](#installation)

`composer require phant/env`

Technologies used
-----------------

[](#technologies-used)

- `PHP 8.1`
- `Composer` for dependencies management (PHP)

Usage
-----

[](#usage)

### Get

[](#get)

If the variable is not defined, an exception will be thrown.

```
use Phant\Env\Manager as Env;

echo Env::get('MY_VAR');
```

### Get with default value

[](#get-with-default-value)

```
use Phant\Env\Manager as Env;

echo Env::get('MY_VAR', 'default value');
```

### Set

[](#set)

If the variable is already defined, an exception will be thrown.

```
use Phant\Env\Manager as Env;

echo Env::set('MY_VAR', 'my new value');
```

### Set value on existing var

[](#set-value-on-existing-var)

```
use Phant\Env\Manager as Env;

echo Env::set('MY_VAR', 'my new value', true);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

1320d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ce749176c74e4c4fd7bd457cdad471fd1e0e14092259e60e7330724ce622dce?d=identicon)[Phant](/maintainers/Phant)

---

Top Contributors

[![lennyrouanet](https://avatars.githubusercontent.com/u/5269913?v=4)](https://github.com/lennyrouanet "lennyrouanet (2 commits)")

---

Tags

env-managerenv componentSimpleEnv

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[horstoeko/zugferdvisualizer

A library

33198.3k2](/packages/horstoeko-zugferdvisualizer)

PHPackages © 2026

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