PHPackages                             dayvsonspacca/psl-toml - 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. dayvsonspacca/psl-toml

ActiveLibrary

dayvsonspacca/psl-toml
======================

A TOML parser for PHP built on top of php-standard-library/php-standard-library

v1.0.5(1mo ago)03MITPHPPHP ^8.4CI passing

Since Mar 4Pushed 1mo agoCompare

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

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

psl-toml
========

[](#psl-toml)

[![Latest Stable Version](https://camo.githubusercontent.com/acf626b83c11f6952a0cb01e43fbf6a58b6a3758adcfd2711b1e00e5c9c56500/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64617976736f6e7370616363612f70736c2d746f6d6c2e737667)](https://packagist.org/packages/dayvsonspacca/psl-toml)[![Total Downloads](https://camo.githubusercontent.com/bb20e3923335a5c2c53f042e6a03ba55000bcf69571e3a41b0a228c59ec1f36a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64617976736f6e7370616363612f70736c2d746f6d6c2e737667)](https://packagist.org/packages/dayvsonspacca/psl-toml)[![License](https://camo.githubusercontent.com/b66b49f7c05813d0729a724fe23c05e8adefa2121a815e9013b76d76a6f2f454/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64617976736f6e7370616363612f70736c2d746f6d6c2e737667)](https://packagist.org/packages/dayvsonspacca/psl-toml)

A [TOML 1.1](https://toml.io/en/v1.1.0) parser for PHP 8.4+ built on top of [azjezz/psl](https://github.com/azjezz/psl).

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

[](#requirements)

- PHP 8.4+
- `php-standard-library/php-standard-library` ^6.1

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

[](#installation)

```
composer require dayvsonspacca/psl-toml
```

Usage
-----

[](#usage)

### Parsing a string

[](#parsing-a-string)

```
use PslToml\Toml;
use Psl\Result\Success;
use Psl\Type;

$result = Toml::parse(unwrap();         // "Alice"
    $doc->get('database.port', Type\int())->unwrap();   // 5432
}
```

### Loading a file

[](#loading-a-file)

```
use PslToml\Toml;
use Psl\Result\Success;
use Psl\Type;

$result = Toml::load('/path/to/config.toml');

if ($result instanceof Success) {
    $doc = $result->getResult();
}
```

### Working with the Document

[](#working-with-the-document)

```
// Check if a key exists
$doc->has('database.host'); // true

// Get a nested table as a Document
$db = $doc->table('database')->unwrap();
$db->get('host', Type\string())->unwrap(); // "localhost"

// List top-level keys
$doc->keys(); // ['name', 'version', 'database']

// Export to a plain PHP array
$doc->toArray();
```

### Result API

[](#result-api)

Both `Toml::parse()` and `Toml::load()` return a `Psl\Result\ResultInterface`, so you never need a `try/catch`:

```
use Psl\Result\Success;
use Psl\Result\Failure;

$result = Toml::parse($source);

if ($result instanceof Failure) {
    $error = $result->getThrowable(); // ParseException with position info
}
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance97

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

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

Every ~4 days

Total

6

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7770f1974011e2b45f94474fa2d0ae50930ae8cb65eb38a77a41bbb1a5f0ac8?d=identicon)[dayvsonspacca](/maintainers/dayvsonspacca)

---

Top Contributors

[![dayvsonspacca](https://avatars.githubusercontent.com/u/64930283?v=4)](https://github.com/dayvsonspacca "dayvsonspacca (37 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dayvsonspacca-psl-toml/health.svg)

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

###  Alternatives

[maglnet/composer-require-checker

CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package

99810.9M670](/packages/maglnet-composer-require-checker)[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M55](/packages/roave-backward-compatibility-check)[veewee/xml

XML without worries

1835.9M29](/packages/veewee-xml)[php-soap/ext-soap-engine

An ext-soap engine implementation

443.2M7](/packages/php-soap-ext-soap-engine)[php-soap/engine

SOAP engine design

273.4M25](/packages/php-soap-engine)

PHPackages © 2026

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