PHPackages                             rfussien/dotenv - 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. rfussien/dotenv

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

rfussien/dotenv
===============

dotenv loader/parser improved for performance

v1.0.0(9y ago)35.0kMITPHPPHP ~5.6|~7.0

Since Feb 2Pushed 9y ago2 watchersCompare

[ Source](https://github.com/rfussien/dotenv)[ Packagist](https://packagist.org/packages/rfussien/dotenv)[ Docs](https://github.com/rfussien/dotenv)[ RSS](/packages/rfussien-dotenv/feed)WikiDiscussions master Synced 2mo ago

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

dotenv
======

[](#dotenv)

[![Latest Version on Packagist](https://camo.githubusercontent.com/800cceb1bd323d7a420b7a63c20504743338fdd43ae1774d1a58ab9599cfa45f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726675737369656e2f646f74656e762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rfussien/dotenv)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/4a2d285f2293e4a23164424cd05e43dde4de738ec376e7aba11a3535f3947609/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726675737369656e2f646f74656e762f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rfussien/dotenv)[![Coverage Status](https://camo.githubusercontent.com/5b7448e3bce2d027ce2725c998b8d55123cad4f49736d0ca97e416e83425d3b1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f726675737369656e2f646f74656e762e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rfussien/dotenv/code-structure)[![Quality Score](https://camo.githubusercontent.com/95ca574aad05608c7d7c1fcd6e94b46e73b786775a2273566dc2b6e1a9bb2846/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f726675737369656e2f646f74656e762e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/rfussien/dotenv)[![Total Downloads](https://camo.githubusercontent.com/d1496d9377a0a50864d4fe51481adb7d31b34fe52ab47aa433cd001af2f1b242/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726675737369656e2f646f74656e762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rfussien/dotenv)

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

[](#requirements)

PHP &gt;= 5.6 | &gt;= 7.0 | &gt;= 7.1
⚠️**HHVM not supported so far**⚠️

Install
-------

[](#install)

Via Composer

```
$ composer require rfussien/dotenv
```

Usage
-----

[](#usage)

```
$dotenv = new Rfussien\Dotenv\Loader(__DIR__);
$dotenv->load();

// optionally you can set a different filename (by defaul .env)
$dotenv = new Rfussien\Dotenv\Loader(__DIR__, '.my.env');
$dotenv->load();
```

Why should I use this dotenv loader instead of another ?
--------------------------------------------------------

[](#why-should-i-use-this-dotenv-loader-instead-of-another-)

This package is meant to be faster than the other dotenv loaders.
But please, don't believe me, check my [small benchmark](https://github.com/rfussien/dotenv-benchmark) out, and try it by yourself.

It has less features, but come on, it's about a config file and a minimum computing should be done...

IMHO:

- A real boolean **MUST NOT** be between quotes
- A string **SHOULD** be between quotes or double quotes
- An empty value is **not null**, but an empty string
- Computing nested values every single time my app runs is a waste of time

Results
-------

[](#results)

In the .envtypevalueK01=truebooltrueK02=tRuEbooltrueK03="true"string(4)"true"K04=onbooltrueK05=OnbooltrueK06="on"string(2)"on"K07=yesbooltrueK08=YesbooltrueK09="yes"string(3)"yes"K10=falseboolfalseK11=fAlSeboolfalseK12="false"string(5)"false"K13=offboolfalseK14=OffboolfalseK15="off"string(3)"off"K16=noboolfalseK17=NoboolfalseK18="no"string(2)"no"K19=1int1K20=1.1double1.1K21=valuestring(5)"value"K22="value"string(5)"value"K23="VaLuE"string(5)"VaLuE"K24=VaLuEstring(5)"VaLuE"K25="value " value"string(13)"value " value"K26="value "value" value"string(19)"value "value" value"K27="value 'value' value"string(19)"value 'value' value"K28=""string(0)""K29= valuestring(5)"value"K30='value'string(5)"value"K31=''string(0)""K32=string(0)""K33=nullNULLNULLTesting
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Remi FUSSIEN](https://github.com/rfussien)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/488c93e63cb2701a038be750682c86b97ef3ddf63f6ad0397471e38dc77e7c4a?d=identicon)[rfussien](/maintainers/rfussien)

---

Top Contributors

[![rfussien](https://avatars.githubusercontent.com/u/3856033?v=4)](https://github.com/rfussien "rfussien (1 commits)")

---

Tags

dotenvphpphp-librarydotenvrfussien

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[symfony/dotenv

Registers environment variables from a .env file

3.8k226.7M2.3k](/packages/symfony-dotenv)[josegonzalez/dotenv

dotenv file parsing for PHP

2799.8M137](/packages/josegonzalez-dotenv)[helhum/dotenv-connector

Makes it possible to set environment variables for composer projects.

1594.6M34](/packages/helhum-dotenv-connector)[m1/env

Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.

6412.0M21](/packages/m1-env)[jackiedo/dotenv-editor

The .env file editor tool for Laravel 5.8+

2041.2M31](/packages/jackiedo-dotenv-editor)

PHPackages © 2026

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