PHPackages                             bezier/msgpack-php - 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. bezier/msgpack-php

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

bezier/msgpack-php
==================

MessagePack with pure PHP fail over

1.0.0(11y ago)52322[1 PRs](https://github.com/bezier/msgpack-php/pulls)PHPPHP &gt;=5.4.0

Since Oct 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/bezier/msgpack-php)[ Packagist](https://packagist.org/packages/bezier/msgpack-php)[ RSS](/packages/bezier-msgpack-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

MessagePack PHP
===============

[](#messagepack-php)

The purpose of this project is to implement [MessagePack](http://msgpack.org/) serialization with PHP failover. This might be useful for someone unable to install php-modules, or using [HipHop](https://github.com/facebook/hiphop-php) to compile PHP as C++.

Composer
--------

[](#composer)

Project
-------

[](#project)

Please see:

Example
-------

[](#example)

```
  use CharStream;

  $hole = "Light"
  $pack = msgpack_pack($hole);

  if ( msgpack_unpage($pack) === $hole ) {
       echo "The hole is lit.";
  }

```

Caveats
-------

[](#caveats)

- Only msgpack\_pack() and msgpack\_unpack() are defined.
- It's only tested on [little endian](http://en.wikipedia.org/wiki/Endianness) architecture, but should work on big endian as well, please test it if able.
- The uint64 and int64 types probably requires 64-bit systems to work
- It uses is\_x() to select the type, do your casts before using the functions
- Unlike the official lib you can't pack objects. If you know how to do this please fork.
- It will always pack integers into the least amount of bits possible, and will prefer unsigned.

Benchmark
---------

[](#benchmark)

Based on [msgpack/php/benchmark.php](https://github.com/msgpack/msgpack/blob/master/php/benchmark.php)

As you can see the pure PHP implementation (msgpack-php) is quite slow compared with the great php-extension msgpack has created. However when msgpack-php is compiled using HipHop (msgpack-hphp) the performance difference is much less, with msgpack-hphp even beating msgpack in this particular benchmark a few places, perhaps due to the fact that the benchmark itself is compiled with HipHop as well.

The timing values are average seconds sampled 10 times with 10.000 iterations each. Percentages are relative to normal php serialize() (not HipHop's version).

```
[integer   ]       default          json      igbinary       msgpack   msgpack-php   msgpack-hphp
status     :           OK           OK           OK           OK           OK          OK
serialize  : 0.0105 (100%) 0.0090 ( 85%) 0.0089 ( 84%) 0.0093 ( 88%) 0.0550 ( 523%) 0.0051 ( 57%)
unserialize: 0.0089 (100%) 0.0119 (134%) 0.0088 ( 99%) 0.0090 (101%) 0.0985 (1110%) 0.0208 (234%)
size       :     12 (100%)      9 ( 75%)      9 ( 75%)      5 ( 41%)      5 (  41%)      5 ( 41%)

[double    ]       default          json      igbinary       msgpack   msgpack-php   msgpack-hphp
status     :           OK           OK           OK           OK           OK          OK
serialize  : 0.0323 (100%) 0.0132 ( 40%) 0.0092 ( 28%) 0.0094 ( 28%) 0.0740 (229%)  0.0074 ( 23%)
unserialize: 0.0221 (100%) 0.0124 ( 56%) 0.0085 ( 38%) 0.0089 ( 40%) 0.1151 (521%)  0.0217 ( 98%)
size       :     54 (100%)     15 ( 27%)     13 ( 24%)      9 ( 16%)      9 ( 16%)       9 ( 16%)

[string    ]       default          json      igbinary       msgpack   msgpack-php   msgpack-hphp
status     :           OK           OK           OK           OK           OK          OK
serialize  : 0.0104 (100%) 0.0123 (118%) 0.0092 ( 88%) 0.0096 ( 91%) 0.0728 ( 700%) 0.0067 ( 64%)
unserialize: 0.0095 (100%) 0.0153 (160%) 0.0093 ( 97%) 0.0097 (101%) 0.1469 (1543%) 0.0301 (316%)
size       :     40 (100%)     34 ( 85%)     38 ( 95%)     35 ( 87%)     35 (  87%)     35 ( 87%)

[array     ]       default          json      igbinary       msgpack   msgpack-php   msgpack-hphp
status     :           OK           OK           OK           OK           OK          OK
serialize  : 0.0183 (100%) 0.0297 (162%) 0.0222 (121%) 0.0134 ( 73%) 0.5567 (3042%) 0.0432 (236%)
unserialize: 0.0174 (100%) 0.0363 (207%) 0.0171 ( 98%) 0.0170 ( 97%) 0.7823 (4483%) 0.1665 (957%)
size       :    226 (100%)    176 ( 77%)    186 ( 82%)    176 ( 77%)    176 (  77%)    176 ( 77%)

[array     ]       default          json      igbinary       msgpack    msgpack-php   msgpack-hphp
status     :           OK           OK           OK           OK           OK           OK
serialize  : 0.0199 (100%) 0.0481 (242%) 0.0306 (153%) 0.0148 ( 74%) 0.8513 (4285%) 0.0763 ( 383%)
unserialize: 0.0231 (100%) 0.0583 (252%) 0.0202 ( 87%) 0.0248 (107%) 1.4168 (6134%) 0.3156 (1366%)
size       :    406 (100%)    351 ( 86%)    346 ( 85%)    351 ( 86%)    351 (  86%)    351 (  86%)

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

4316d ago

### Community

Maintainers

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

---

Top Contributors

[![cypres](https://avatars.githubusercontent.com/u/629894?v=4)](https://github.com/cypres "cypres (8 commits)")[![t4g](https://avatars.githubusercontent.com/u/1277253?v=4)](https://github.com/t4g "t4g (2 commits)")

### Embed Badge

![Health badge](/badges/bezier-msgpack-php/health.svg)

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

###  Alternatives

[mwgg/airports

A JSON collection of ~29k entries with basic information about nearly every airport and landing strip in the world

7683.4k](/packages/mwgg-airports)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9845.4k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46164.0k6](/packages/jstewmc-rtf)[glauberportella/cnab-layouts-parser

Parser de arquivos de configuração CNAB gerados no projeto https://github.com/glauberportella/cnab-layouts

2154.5k](/packages/glauberportella-cnab-layouts-parser)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.4k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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