PHPackages                             honzabrecka/transit-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. honzabrecka/transit-php

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

honzabrecka/transit-php
=======================

Transit for PHP.

0.8.5(2y ago)1831.0k↓50%3[1 issues](https://github.com/honzabrecka/transit-php/issues)1MITPHPPHP &gt;=5.6.0

Since Oct 27Pushed 2y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (2)Versions (9)Used By (1)

transit-php
===========

[](#transit-php)

Transit is a data format and a set of libraries for conveying values between applications written in different languages. This library provides support for marshalling Transit data to/from PHP. Unlike the Java and Clojure implementations it relies on the non-streaming JSON parsing mechanism of the host PHP environment.

- [Rationale](http://blog.cognitect.com/blog/2014/7/22/transit)
- [Specification](http://github.com/cognitect/transit-format)

This implementation's major.minor version number corresponds to the version of the Transit specification it supports.

*NOTE: Transit is a work in progress and may evolve based on feedback. As a result, while Transit is a great option for transferring data between applications, it should not yet be used for storing data durably over time. This recommendation will change when the specification is complete.*

Installation
------------

[](#installation)

```
composer require honzabrecka/transit-php

```

Usage
-----

[](#usage)

```
use transit\JSONReader;
use transit\JSONWriter;
use transit\Transit;
use transit\Map;

$transit = new Transit(new JSONReader(), new JSONWriter());
$transit->read('["^ ","foo","bar"]');
$transit->write(new Map(['foo', 'bar']));
```

You can use assoc array instead of transit\\Map. It comes with a price (string keys only), therefore it's disabled by default.

```
use transit\JSONReader;
use transit\JSONWriter;
use transit\Transit;

$transit = new Transit(new JSONReader(true), new JSONWriter(true));
$transit->read('["^ ","foo","bar"]');
$transit->write(['foo' => 'bar']);
```

Default Type Mapping
--------------------

[](#default-type-mapping)

Transit typeWrite acceptsRead returnsnullnullnullstringstringstringbooleanboolboolintegerintintdecimalfloatfloatbytestransit\\Bytestransit\\Byteskeywordtransit\\Keywordtransit\\Keywordsymboltransit\\Symboltransit\\SymboltimeDateTimeDateTimearrayarrayarraymaptransit\\Map or assoc arraytransit\\Map or assoc arraycmaptransit\\CMaptransit\\CMapsettransit\\Settransit\\SetlistSplDoublyLinkedListSplDoublyLinkedListuritransit\\URItransit\\URIuuidtransit\\UUIDtransit\\UUIDchartransit\\Chartransit\\Char

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98% 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 ~589 days

Recently: every ~661 days

Total

6

Last Release

909d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99d77e8855da21173568dd916deb766131137f0d246f609b1cc548ac6209db78?d=identicon)[honzabrecka](/maintainers/honzabrecka)

---

Top Contributors

[![honzabrecka](https://avatars.githubusercontent.com/u/1021827?v=4)](https://github.com/honzabrecka "honzabrecka (50 commits)")[![vincent-dm](https://avatars.githubusercontent.com/u/8799841?v=4)](https://github.com/vincent-dm "vincent-dm (1 commits)")

---

Tags

formatphptransitdataformattransit

### Embed Badge

![Health badge](/badges/honzabrecka-transit-php/health.svg)

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

###  Alternatives

[apache/avro

Apache Avro™ is a data serialization system.

3.2k26.8k3](/packages/apache-avro)[samayo/country-json

A simple but useful data of the world (by country) in JSON formats

1.1k22.4k](/packages/samayo-country-json)[dragon-code/codestyler

A tool to automatically fix Coding Style Standards issues by The Dragon Code.

291.8M16](/packages/dragon-code-codestyler)[helgesverre/toon

Token-Oriented Object Notation - A compact data format for reducing token consumption when sending structured data to LLMs

11841.4k9](/packages/helgesverre-toon)[jstewmc/rtf

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

44127.5k6](/packages/jstewmc-rtf)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)

PHPackages © 2026

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