A pure PHP implementation of the MessagePack serialization format, supporting streaming unpacking, custom types, and extensions.
msgpack.php is a pure PHP implementation of the MessagePack binary serialization format. It provides a robust and efficient alternative to JSON for data interchange, with full specification compliance and a focus on performance. The library offers both high-level convenience methods and low-level, fine-grained control over serialization and deserialization processes.
PHP developers who need efficient binary data serialization for network communication, caching, or data storage, especially those working with microservices, real-time applications, or performance-critical systems. It's also suitable for developers requiring custom type serialization or strict MessagePack specification compliance.
Developers choose msgpack.php for its strict adherence to the MessagePack specification, ensuring interoperability with other implementations, and its comprehensive feature set including streaming unpacking, custom type handling via transformers and extensions, and performance optimizations. It provides a clean, object-oriented API while offering more control and flexibility than basic serialization libraries.
A pure PHP implementation of the MessagePack serialization format / msgpack.org[PHP]
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements the latest MessagePack specification, ensuring interoperability with other systems, as highlighted in the README's key features.
Supports unpacking from streams or chunks with BufferUnpacker methods like append and tryUnpack, ideal for network communication as detailed in the Usage section.
Allows serialization of custom objects and types through transformers and extensions, with examples for DateTime and streams provided in the README.
Includes comprehensive benchmarks and supports JIT compilation for high-speed serialization, with performance tests documented in the README.
Custom type handling requires implementing interfaces like CanBePacked or registering transformers and extensions, adding setup complexity beyond basic usage.
Benchmarks show the pure PHP implementation is slower than the PECL msgpack extension in some scenarios, as indicated in the performance comparison tables.
Requires unpacking options like BIGINT_AS_STR or GMP for 64-bit integers due to PHP limitations, which can be non-intuitive for simple data types.