PHPackages                             masnathan/parser - 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. masnathan/parser

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

masnathan/parser
================

Global data type parser

v0.0.1(10y ago)013.0k1[2 issues](https://github.com/MASNathan/Parser/issues)2MITPHPPHP &gt;=5.3.0

Since Aug 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/MASNathan/Parser)[ Packagist](https://packagist.org/packages/masnathan/parser)[ Docs](https://github.com/masnathan/parser)[ RSS](/packages/masnathan-parser/feed)WikiDiscussions master Synced 1mo ago

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

Parser
======

[](#parser)

[![Latest Version on Packagist](https://camo.githubusercontent.com/68cf6626d9b81c8b62d3ace5789d89cff51cf218dd89b4cfd75eeac61200dd7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61736e617468616e2f7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masnathan/parser)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/de426996de5f03a3115d0a3387c5f6fd8044fad2add7eaf1de187684602634cf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4d41534e617468616e2f5061727365722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/MASNathan/Parser)[![Coverage Status](https://camo.githubusercontent.com/03f843f71c70340e9076519c120e26da89f39f235f5c339d12d438b9927f6bf8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d61736e617468616e2f7061727365722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/masnathan/parser/code-structure)[![Quality Score](https://camo.githubusercontent.com/4897b3104563012d435292671c42913b0c920aca74a4a27f152ec7b4b30e4b1b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d61736e617468616e2f7061727365722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/masnathan/parser)[![Total Downloads](https://camo.githubusercontent.com/8856397e3ecd7df0ebb5901d7f4656b649992325ddb3e1a63ed7fe1948fdb40f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61736e617468616e2f7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masnathan/parser)[![Support via Gittip](https://camo.githubusercontent.com/6865526ae6b386af2e4bb51ad60398746a13de749165ff5e3ad8de17f47836f3/68747470733a2f2f696d672e736869656c64732e696f2f6769747469702f4d41534e617468616e2e7376673f7374796c653d666c61742d737175617265)](https://gratipay.com/~MASNathan/)

Global data type parser

Install
-------

[](#install)

Via Composer

```
$ composer require masnathan/parser
```

Usage
-----

[](#usage)

```
use MASNathan\Parser\Parser;

$data = array(
    'foo' => 'bar',
    'sup' => 'World'
);

$content = Parser::data($data);
$content->setPrettyOutput(true);

echo $content->to('json'); // outputs in json format
echo $content->to('xml'); // outputs in xml format
```

And also...

```
$content = Parser::file('path/to/my/file.json')->from('json');

echo $content->to('xml'); // outputs in xml format

// or
echo Parser::file('path/to/my/file.xml')
		->from('xml')
		->setPrettyOutput(true)
		->to('yaml');
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

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

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [André Filipe](https://github.com/masnathan)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

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

Unknown

Total

1

Last Release

3913d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2139464?v=4)[André Filipe](/maintainers/MASNathan)[@MASNathan](https://github.com/MASNathan)

---

Top Contributors

[![MASNathan](https://avatars.githubusercontent.com/u/2139464?v=4)](https://github.com/MASNathan "MASNathan (12 commits)")

---

Tags

phpjsonxmlparserdatayamlencodedecode

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)

PHPackages © 2026

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