Download the PHP package manoj/toon-php-lite without Composer
On this page you can find all versions of the php package manoj/toon-php-lite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package toon-php-lite
🚀 TOON PHP Lite
A lightweight, dependency-free PHP library for encoding & decoding TOON (Token-Oriented Object Notation).
TOON is a compact, human-readable, LLM-friendly data format — an alternative to JSON that uses indentation, lists, and tabular rows for intuitive structure.
This library provides a lite encoder + decoder, suitable for everyday PHP applications, config parsing, and AI-driven workflows.
✨ Features
▶ Encoding & Decoding
- Simple API:
Toon::encode()/Toon::decode() -
Full support for:
- Nested objects via indentation
- Primitive arrays:
tags[3]: php,ai,iot -
List arrays:
- Tabular arrays (
key[n]{a,b,c}:):
▶ New in v0.4.0
-
Triple-quoted multiline strings
-
Minified TOON output (fully valid, no indentation)
- Complete test suite + round-trip stability checks
- PHPStan clean (level 8)
- Strict types everywhere
▶ Other Features
- Zero dependencies
-
Detailed decode errors
- row count mismatches
- bad tabular rows
- invalid indentation
-
Comment support:
# comment// commentid: 1 # inline
Supports PHP 8.1 – 8.3
📦 Installation
via Packagist
Development
🚀 Quick Start
Output
📘 API Reference
ToonLite\Toon::encode(mixed $data, EncodeOptions|int|null $options = null): string
Encodes PHP values into valid TOON text.
Supported mappings
Objects
→
Primitive arrays
→
List arrays
→
Tabular arrays
→
✔ Multiline strings (NEW in v0.4.0)
→
✔ Minify mode (NEW in v0.4.0)
Output:
ToonLite\Toon::decode(string $toon): mixed
Parses TOON back into PHP:
- associative arrays
- numeric arrays
- ints, floats, strings, bool, null
- multiline strings
- tabular & list arrays
- nested objects based on indentation
Comments
🔧 Development
Run tests
Static analysis
Code style (optional)
🗺 Roadmap
Completed in v0.4.0
- [x] Multiline string support
- [x] Minified output
- [x] Strict decoder rewrite
- [x] 100% PHPUnit coverage
- [x] PHPStan level-8 clean
- [x] EncodeOptions overhaul
Coming next
- [ ] Object-level annotations
- [ ] TOON schema validation
- [ ] Streaming decoder (very large files)
- [ ] Official TOON conformance tests
- [ ] Error messages with line/column numbers
📄 License
MIT © Manoj Ramamurthy