Pure PHP implementation of msgpack serialization