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

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

kdl/kdl
=======

A PHP implementation for the KDL data format

0.4.0(5y ago)1849↓90.9%4[3 issues](https://github.com/kdl-org/kdl-php/issues)[2 PRs](https://github.com/kdl-org/kdl-php/pulls)MITPHPPHP &gt;=7.4

Since Jan 8Pushed 1y ago2 watchersCompare

[ Source](https://github.com/kdl-org/kdl-php)[ Packagist](https://packagist.org/packages/kdl/kdl)[ RSS](/packages/kdl-kdl/feed)WikiDiscussions main Synced 3w ago

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

[![Latest Stable Version](https://camo.githubusercontent.com/51cf0ccf711466604a2784f5a917453261e53c59dc26ec6b370c79e1c555924b/68747470733a2f2f706f7365722e707567782e6f72672f6b646c2f6b646c2f76)](//packagist.org/packages/kdl/kdl) [![License](https://camo.githubusercontent.com/f607730ec206ca14e18a5356c7f5115dd45ee60af8ff0ae55f58115297176d6d/68747470733a2f2f706f7365722e707567782e6f72672f6b646c2f6b646c2f6c6963656e7365)](//packagist.org/packages/kdl/kdl) [![Status](https://github.com/kdl-org/kdl-php/workflows/Project%20checks/badge.svg?branch=main)](https://github.com/kdl-org/kdl-php/workflows/Project%20checks/badge.svg?branch=main)

KDL-PHP
=======

[](#kdl-php)

A PHP library for the [KDL Document Language](https://kdl.dev) (pronounced like "cuddle").

[![alt text](./kdl.svg "KDL logo")](./kdl.svg)

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

[](#installation)

The KDL library can be included to your project using Composer:

`composer require kdl/kdl`

Limitations
-----------

[](#limitations)

For now, this library only supports parsing.

Parsing a 45 line file with a tree depth of 5 is likely to take about 30ms currently - this speed is improving all the time with releases of the underlying parser library. This library favours correctness over performance - however, the aim is for parse speed to improve to a point of being reasonable.

The parser uses [Parsica](https://parsica.verraes.net/) as an underlying parsing library in order to map fairly directly and clearly onto the published KDL grammar - Parsica uses FP principles, and one result of this is that the call stack depth used during parsing may be high. Be warned if you are using e.g. xdebug, as parsing may exceed any normal maximum stack depth that you may set.

Examples
--------

[](#examples)

```
$document = Kdl\Kdl\Kdl::parse($kdlString);
foreach ($document as $node) {
    $node->getName(); //gets the name for the node @see https://github.com/kdl-org/kdl/blob/main/SPEC.md#node
    $node->getValues(); //gets a list of values for a node @see https://github.com/kdl-org/kdl/blob/main/SPEC.md#value
    $node->getProperties(); //gets an associative array of properties @see https://github.com/kdl-org/kdl/blob/main/SPEC.md#property
    foreach ($node->getChildren() as $child) {
        $child->getName(); //name for the child
       //etc
    }
}
```

License
-------

[](#license)

The code is available under the [MIT license](LICENSE).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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 ~35 days

Total

5

Last Release

1860d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67cf8ed88be79605642722cbc5902206c2e51adf755f70cfff04b2c7e5abc9ce?d=identicon)[shieldo](/maintainers/shieldo)

---

Top Contributors

[![shieldo](https://avatars.githubusercontent.com/u/97280?v=4)](https://github.com/shieldo "shieldo (29 commits)")

---

Tags

kdlparser

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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