PHPackages                             fandogh/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fandogh/php-ubjson

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fandogh/php-ubjson
==================

v0.2.2(9y ago)1627BSD-3-ClausePHPPHP &gt;=5.3.0

Since Jul 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/pi0/php-ubjson)[ Packagist](https://packagist.org/packages/fandogh/php-ubjson)[ RSS](/packages/fandogh-php-ubjson/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (5)Used By (0)

PHP-UBJSON
==========

[](#php-ubjson)

[![Packagist](https://camo.githubusercontent.com/6773fa44d21347f7855edd50cf1d10ebb709fffdf1aa50e12a25dd37572010d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66616e646f67682f7068702d75626a736f6e2e737667)](https://packagist.org/packages/fanndogh/php-ubjson)[![Packagist](https://camo.githubusercontent.com/65429740e0a4f7df1d7f0fb49cfd277605edb631b4919e35c5660180046be0c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66616e646f67682f7068702d75626a736f6e2e737667)](https://packagist.org/packages/fandogh/php-ubjson)

A library to read and write to the [Universal Binary JSON](http://ubjson.org/ "ubjson.org") (Draft 9) format using PHP

Install using composer
======================

[](#install-using-composer)

Using command line:

```
composer require fandogh/php-ubjson
```

Or add this to your `composer.json` file:

```
"require": {
  ...
  "fandogh/php-ubjson": "^0.2.2",
  ...
}
```

Usage
=====

[](#usage)

PLEASE NOTE THAT ENCODED RESULT IS A BINARY STRING and some charachters are non printable!!

```
// Don't forget to require autoload.php with correct path
require './vendor/autoload.php';

// Test data
$payload = ['hello'=>123];

// Encode using UBJSON
$encoded = \UBJSON::encode($payload);

# Incorrect!
echo($encoded); // {SU�helloU{}

# Correct!
echo(bin2hex($encoded)); // "7b53550568656c6c6f557b7d"

// Test decoding
$decoded = \UBJSON::decode($encoded);

var_dump($decoded); // array(1) { ["hello"]=> int(123) }
```

Licence
=======

[](#licence)

This code is distributed under BSD license.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.8% 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 ~373 days

Total

4

Last Release

3623d ago

PHP version history (2 changes)v0.1PHP  5.3.0

v0.2PHP &gt;=5.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/247155?v=4)[Shayan Pooya](/maintainers/pooya)[@pooya](https://github.com/pooya)

---

Top Contributors

[![dizews](https://avatars.githubusercontent.com/u/452641?v=4)](https://github.com/dizews "dizews (14 commits)")[![pi0](https://avatars.githubusercontent.com/u/5158436?v=4)](https://github.com/pi0 "pi0 (9 commits)")[![mihai-stancu](https://avatars.githubusercontent.com/u/1294142?v=4)](https://github.com/mihai-stancu "mihai-stancu (2 commits)")[![rafsalvioni](https://avatars.githubusercontent.com/u/3233877?v=4)](https://github.com/rafsalvioni "rafsalvioni (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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