PHP code example of bogosoft / serialization

1. Go to this page and download the library: Download bogosoft/serialization library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bogosoft / serialization example snippets


$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)