PHPackages                             bert/bert - 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. bert/bert

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

bert/bert
=========

A BERT (Binary ERlang Term) serialization library.

118PHP

Since Dec 8Pushed 12y ago1 watchersCompare

[ Source](https://github.com/TriKaspar/bert-php)[ Packagist](https://packagist.org/packages/bert/bert)[ RSS](/packages/bert-bert/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/18bf553f0a576a2d9bf157400f39531e2f3ca308c5b520e9d9f598c4e127060e/68747470733a2f2f7472617669732d63692e6f72672f5472694b61737061722f626572742d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/TriKaspar/bert-php)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/75763e1a3b827993a3bd35f2bcf42cceb60dc69cab8dd4811cd2c9f402ad0228/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5472694b61737061722f626572742d7068702f6261646765732f7175616c6974792d73636f72652e706e673f733d31393539666532353561643938353138386539613735333563313831363761343535656164633065)](https://scrutinizer-ci.com/g/TriKaspar/bert-php/)

\##Note - Work in progress
This is a fork of
I made it composer compatible and eleminated the fdopen dependency.

BERT
====

[](#bert)

A BERT (Binary ERlang Term) serialization library for PHP based on [Tom Preston-Werner's Ruby implementation](http://github.com/mojombo/bert).

It can encode PHP objects into BERT format and decode BERT binaries into PHP objects.

See the BERT specification at [bert-rpc.org](http://bert-rpc.org).

To designate an atom, use the Bert::a() helper or the Bert\_Atom class. To designate tuples, use the Bert::t() helper or the Bert\_Tuple class:

```
Bert::t(Bert::a('foo'), array(1, 2, 3))
new Bert_Tuple(array(new Bert_Atom('foo'), array(1, 2, 3)))

```

These will both be converted to (in Erlang syntax):

```
{foo, [1, 2, 3]}

```

Usage
-----

[](#usage)

```
require_once 'classes/Bert.php'

$bert = Bert::encode(
  Bert::t(
    Bert::a('user'),
    array('name' => 'TPW', 'nick' => 'mojombo')
  )
);
# => string(82) "#hduserhdbertddictllmnamemTPWjlmnickmmojombojj"

Bert::decode($bert);
# => Bert_Tuple (
       Bert_Atom ( 'user' ),
       Array (
         'name' => 'TPW',
         'nick' => 'mojombo'
       )
     )

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/11afe4ae2ef678434faf0ab4b2b5faa8c52a6976e3837b1eb07927035d726c1e?d=identicon)[kasparp](/maintainers/kasparp)

### Embed Badge

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

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

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[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.

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

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

46143.1k6](/packages/jstewmc-rtf)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

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

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

PHPackages © 2026

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