PHPackages                             bgaze/php-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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. bgaze/php-dotenv

ArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

bgaze/php-dotenv
================

A simple and standalone PHP parser for DotEnv files

v1.1.0(6y ago)146MITPHPPHP ^5.3.3 || ^7.0

Since Sep 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bgaze/php-dotenv)[ Packagist](https://packagist.org/packages/bgaze/php-dotenv)[ RSS](/packages/bgaze-php-dotenv/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

php-dotenv
==========

[](#php-dotenv)

A simple and standalone DotEnv parser for PHP 5.6+ wich sticks to a unique goal : parse a Dotenv string/file and restitute it as an array of variables.

Documentation
-------------

[](#documentation)

Full documentation is available at

Quick start
-----------

[](#quick-start)

Simply install the library using composer:

```
composer require bgaze/php-dotenv

```

Use the `Helpers` class to parse DotenEnv file or string:

```
use \Bgaze\Dotenv\Helpers as DotEnv;

try {
    var_dump(DotEnv::fromString('a dotenv string', [ /* some default values */ ]));
    var_dump(DotEnv::fromFile('path/to/dotenv/file', [ /* some default values */ ]));
} catch (\Exception $e) {
    echo "{$e}";
}
```

###  Health Score

26

—

LowBetter than 41% 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 ~1 days

Total

3

Last Release

2470d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f4a5f965ee3485d7f2c78450a371d363027a7f10935d6559869874a584d5402?d=identicon)[bgaze](/maintainers/bgaze)

---

Top Contributors

[![bgaze](https://avatars.githubusercontent.com/u/985214?v=4)](https://github.com/bgaze "bgaze (7 commits)")

---

Tags

phpparserdotenv

### Embed Badge

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

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

###  Alternatives

[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k942.7M153](/packages/doctrine-lexer)[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1931.4M15](/packages/simplehtmldom-simplehtmldom)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23790.9k2](/packages/corveda-php-sandbox)[romanpitak/nginx-config-processor

Nginx configuration files processor.

6935.7k1](/packages/romanpitak-nginx-config-processor)[leonelquinteros/php-toml

PHP parser for TOML language ( https://github.com/toml-lang/toml )

276.8k](/packages/leonelquinteros-php-toml)

PHPackages © 2026

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