PHPackages                             krak/marshal - 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. krak/marshal

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

krak/marshal
============

Data marshal and transformation library

v0.2.3(8y ago)21.4k[2 issues](https://github.com/krakphp/marshal/issues)3MITPHPPHP ^5.6 || ^7.0

Since Jul 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/krakphp/marshal)[ Packagist](https://packagist.org/packages/krak/marshal)[ Docs](http://gitlab.bighead.net/krak/marshal)[ RSS](/packages/krak-marshal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (7)Used By (3)

Krak Marshal
============

[](#krak-marshal)

A library for marshaling data with a functional design. This is useful for transforming/marshaling data for API output, un-marshaling and hydrating serialized data, or for any other types types of transforming.

Usage
-----

[](#usage)

```

    Value

        1
        2

        A
        B

        ]]>

XML;
$unmarshal = Krak\Marshal\fromXML();
var_dump($unmarshal($xml));
/** Outputs:
array(5) {
  ["@a"]=>
  string(1) "1"
  ["item"]=>
  string(5) "Value"
  ["items"]=>
  array(1) {
    ["item"]=>
    array(2) {
      [0]=>
      string(1) "1"
      [1]=>
      string(1) "2"
    }
  }
  ["map"]=>
  array(3) {
    ["@id"]=>
    string(1) "1"
    ["a"]=>
    string(1) "A"
    ["b"]=>
    string(1) "B"
  }
  ["node"]=>
  string(7) ""
}
*/
```

### class ArrayKeyAccess

[](#class-arraykeyaccess)

Performs access on arrays via the key.

### class ObjectPropertyAccess

[](#class-objectpropertyaccess)

Performs access on object properties via the property name

### class AnyAccess

[](#class-anyaccess)

Delegates access to either `ArrayKeyAccess` or `ObjectPropertyAccess` if the data is an array or not.

This is the default accessor used.

### access()

[](#access)

Returns a statically cached instance of AnyAccess

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

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

Recently: every ~176 days

Total

6

Last Release

3263d ago

### Community

Maintainers

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

---

Top Contributors

[![ragboyjr](https://avatars.githubusercontent.com/u/1975857?v=4)](https://github.com/ragboyjr "ragboyjr (19 commits)")

---

Tags

api-serializationhydratormarhsallermarshallertransformerMarshalmarshaler

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)[mck89/peast

Peast is PHP library that generates AST for JavaScript code

18934.7M29](/packages/mck89-peast)

PHPackages © 2026

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