bogosoft/serialization

Serialization-related contracts and implementations for PHP.

1.0.0 2019-12-24 04:16 UTC

This package is auto-updated.

Last update: 2024-12-24 15:22:15 UTC


README

A library of contracts and simple implementations for serializing and deserializing data.

Requirements

  • PHP 7.1+

Installation

composer install bogosoft/serialization

Interfaces

Implementations

Example Usage

$serializer = new \Bogosoft\Serialization\PhpSerializer();

$expected = 'Hello, World!';

$handle = fopen('php://memory', 'r+b');

$serialization = $serializer->serialize($handle, $expected);

fseek($handle, 0);

$actual = $serializer->deserialize($handle);

var_dump($actual === $expected); # outputs: bool(true)