mirror of
https://github.com/danog/MagicalSerializer.git
synced 2024-12-03 09:47:46 +01:00
25 lines
482 B
PHP
25 lines
482 B
PHP
<?php
|
|
|
|
require 'vendor/autoload.php';
|
|
class a extends \Volatile
|
|
{
|
|
use \danog\Serializable;
|
|
public function ___construct()
|
|
{
|
|
var_dump('CONSTRUCTED a');
|
|
}
|
|
|
|
public function __wakeup()
|
|
{
|
|
var_dump('WOKE UP a');
|
|
}
|
|
}
|
|
new a();
|
|
class b extends Volatile
|
|
{
|
|
use \danog\Serializable;
|
|
}
|
|
$result = \danog\Serialization::unserialize(file_get_contents('test'));
|
|
var_dump($result);
|
|
file_put_contents('testb', \danog\Serialization::serialize($result));
|