PHPackages                             lum/lum-ubjson - 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. lum/lum-ubjson

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

lum/lum-ubjson
==============

A UBJSON (draft-12) implementation

v1.0.0(3y ago)0991MITPHP

Since Oct 4Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (1)

lum.ubjson.php
==============

[](#lumubjsonphp)

Summary
-------

[](#summary)

A [UBJSON](https://ubjson.org/) (draft-12) implementation.

### Classes

[](#classes)

NameDescriptionLum\\Encode\\UBJSONThe main transcoder class.### Example Usage

[](#example-usage)

#### Quick with defaults

[](#quick-with-defaults)

```
use Lum\Encode\UBJSON;

$encodedString = UBJSON::encode($anArrayOrObject);

$decodedArray = UBJSON::decode($encodedString);
```

#### With extra options

[](#with-extra-options)

```
use Lum\Encode\UBJSON;

// Default option values shown below.
// Only include the ones you want to override.
// 'optimized' and 'draft9' are mutually exclusive.
$ubj = new UBJSON(
[
  'throw'     => true,
  'asArray'   => true,
  'optimized' => false,
  'draft9'    => false,
]);

$encodedString = $ubj->encodeValue($arrayOrObject);

$decodedArrayOrObject = $ubj->decodeValue($encodedString);
```

The `draft9` option is kept only for compatibility with the previous UBJSON implementation that lived in the [lum-encode](https://github.com/supernovus/lum.encode.php) package. It should not be used in new code.

Official URLs
-------------

[](#official-urls)

This library can be found in two places:

- [Github](https://github.com/supernovus/lum.ubjson.php)
- [Packageist](https://packagist.org/packages/lum/lum-ubjson)

Authors
-------

[](#authors)

- Timothy Totten

License
-------

[](#license)

[MIT](https://spdx.org/licenses/MIT.html)

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

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

1312d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ff04349507190155013e4a94a8b14860a7ac57afce4ba97961c7c79bd023dd7?d=identicon)[supernovus](/maintainers/supernovus)

### Embed Badge

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

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

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

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M343](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

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

PHPackages © 2026

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