PHPackages                             infomaniac-amf/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. infomaniac-amf/php

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

infomaniac-amf/php
==================

InfomaniacAMF is a PHP project for the (de)serialization of AMF packets

0.7.0(12y ago)153.3k4[7 issues](https://github.com/infomaniac-amf/php/issues)MITPHPPHP &gt;=5.4

Since Mar 16Pushed 12y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/1009dd12909b91abcaa9bf92cf681b1b40e6a6f8a908ace070f544cf26e64e23/68747470733a2f2f7472617669732d63692e6f72672f696e666f6d616e6961632d616d662f7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/infomaniac-amf/php)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e6ccf51b4f265b1bfa0042739383a13558f55501e8a846f79329f5744f097317/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e666f6d616e6961632d616d662f7068702f6261646765732f7175616c6974792d73636f72652e706e673f733d30323261323665633639386565313666393831613164326636383735373462626363393133356634)](https://scrutinizer-ci.com/g/infomaniac-amf/php/)

Intro
-----

[](#intro)

**AMF** (Action Message Format) is a binary data serialization protocol. Simply put, it transforms objects in memory into a binary string, and can reverse this binary string into an object in memory. It can be used just like `JSON`, and this library has been build to provide a similar API to that exposed by the `JSON` functionality in `PHP`.

### Purpose

[](#purpose)

The purpose of this library is to provide a consistent and symmetric implementation of the `AMF` specification in both `PHP` &amp; `JSON`.

### Why use AMF?

[](#why-use-amf)

Well, it's up to you. `JSON` is perfectly suited to the web, however it does have some shortcomings which are addressed by `AMF`. For starters, `JSON` cannot handle complex object graphs with circular references; additionally, it cannot serialize dates &amp; byte arrays - you would need to do some additional work to support these in `JSON` (convert date to unix timestamp, byte arrays to base64).

### Should I stop using JSON?

[](#should-i-stop-using-json)

Hells no. `JSON` is great; `AMF` can simply provide you with some additional funcitonality which could help you build your web app.

Getting Started
---------------

[](#getting-started)

To begin using this library, you will need to install it via [Composer](https://getcomposer.org/doc/00-intro.md):

```
{
	"require": {
		"infomaniac-amf/php": "dev-master"
	}
}
```

Once you have run `composer install`, you will be able to use the library by simply including `Composer`'s autoloader:

```
