PHPackages                             arzzen/php-flatbuffers - 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. arzzen/php-flatbuffers

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

arzzen/php-flatbuffers
======================

PHP Memory Efficient Serialization Library - FlatBuffers

1.0.2(9y ago)5352[2 issues](https://github.com/arzzen/php-flatbuffers/issues)Apache-2.0PHPPHP &gt;=5.3.0

Since Sep 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/arzzen/php-flatbuffers)[ Packagist](https://packagist.org/packages/arzzen/php-flatbuffers)[ Docs](https://github.com/arzzen/php-flatbuffers)[ RSS](/packages/arzzen-php-flatbuffers/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

### PHP [Memory Efficient Serialization Library](https://github.com/google/flatbuffers)

[](#php-memory-efficient-serialization-library)

[![Build Status](https://camo.githubusercontent.com/4a1013dcacf070821e8f6d34c3c71c4f9a96adb60dbd8b947bf2ead19f4652cb/68747470733a2f2f7472617669732d63692e6f72672f61727a7a656e2f7068702d666c6174627566666572732e737667)](https://travis-ci.org/arzzen/php-flatbuffers)

FlatBuffers is a serialization library for games and other memory constrained apps.

FlatBuffers allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility.

FlatBuffers can be built for many different systems (Android, Windows, OS X, Linux)

*For testing only*

### Composer

[](#composer)

```
{
    "repositories": [
        {
            "url": "https://github.com/arzzen/php-flatbuffers.git",
            "type": "git"
        }
    ],
    "require": {
        "arzzen/php-flatbuffers": "dev-master"
    }
}

```

### Test:

[](#test)

```
use FlatBuffers\Table;
use FlatBuffers\FlatBufferBuilder;
use FlatBuffers\ByteBuffer;
use FlatBuffers\Constants;

class StringWrapper extends Table implements Constants
{

	private $fbb;

	public function __construct(FlatBufferBuilder $flatBufferBuilder)
	{
		$this->fbb = $flatBufferBuilder;
	}

	public function init(ByteBuffer $byteBuffer)
	{
		$this->bb = $byteBuffer;
		$this->bb_pos = $this->bb->getInt($this->bb->getPosition()) + $this->bb->getPosition();

		return $this;
	}

	public function getString($slot = 0)
	{
		$vtable_offset = self::SIZEOF_INT + ($slot * 2);

		$vtable = $this->bb_pos - $this->bb->getInt($this->bb_pos);

		$offset = $vtable_offset < $this->bb->getShort($vtable) ? $this->bb->getShort($vtable + $vtable_offset) : 0;

		$offset += $this->bb_pos + $this->bb->getInt($offset + $this->bb_pos);
		$len = $this->bb->getInt($offset);
		$startPos = $offset + self::SIZEOF_INT;
		$_string = substr($this->bb->_buffer, $startPos, $len);

		return ($offset != 0 ? $_string : null);
	}

	public function createString($value)
	{
		return $this->fbb->createString($value);
	}

	public function addString($slot, $str)
	{
		$this->fbb->addOffsetX($slot, $str, 0);
	}

	public function dataBuffer()
	{
		return $this->fbb->dataBuffer();
	}

	public function startObject($numfields)
	{
		$this->fbb->startObject($numfields);
	}

	public function endObject()
	{
		return $this->fbb->endObject();
	}

	public function finish($root_table, $identifier = NULL)
	{
		$this->fbb->finish($root_table, $identifier);
	}

}

$flatBufferBuilder = new FlatBufferBuilder(1);
$stringWrapper = new StringWrapper($flatBufferBuilder);

// set string
$firstText = $stringWrapper->createString('first_value');
$secondText = $stringWrapper->createString('second_value');

$stringWrapper->startObject(25);
$stringWrapper->addString(2, $firstText);
$stringWrapper->addString(3, $secondText);
$stringWrapper->finish($stringWrapper->endObject());

// get string
$stringWrapper->init($stringWrapper->dataBuffer());

echo $stringWrapper->getString(2);
echo $stringWrapper->getString(3);

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

3

Last Release

3411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ac9bdd7b00d31612964e78d32fde2b346252671da0706c9ff3bc797e5e647b9?d=identicon)[arzzen](/maintainers/arzzen)

---

Top Contributors

[![arzzen](https://avatars.githubusercontent.com/u/6382002?v=4)](https://github.com/arzzen "arzzen (30 commits)")

---

Tags

flatbuffersphpphp-flatbuffersserialization-libraryphpgoogleserializememoryflatbuffers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arzzen-php-flatbuffers/health.svg)

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

###  Alternatives

[google/flatbuffers

FlatBuffers for PHP

25.7k134.7k4](/packages/google-flatbuffers)[zumba/json-serializer

Serialize PHP variables, including objects, in JSON format. Support to unserialize it too.

129743.7k13](/packages/zumba-json-serializer)[corveda/php-sandbox

A PHP library that can be used to run PHP code in a sandboxed environment

23483.5k2](/packages/corveda-php-sandbox)[bupy7/xml-constructor

The array-like constructor of XML document structure.

1337.9k](/packages/bupy7-xml-constructor)

PHPackages © 2026

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