MagicalSerializer/a.php

21 lines
334 B
PHP
Raw Normal View History

2017-04-30 18:38:55 +02:00
<?php
2017-04-30 18:44:58 +02:00
class a
{
}
class b
{
2017-04-30 18:38:55 +02:00
}
2017-04-30 18:44:58 +02:00
$a = new a();
$a->a = ['lel', ['lel', [new a()]]];
$a->b = new a();
$a->b->c = [new a()];
2017-04-30 18:38:55 +02:00
$a->b->c[0]->d = 'cos';
2017-04-30 18:44:58 +02:00
$a->b->c[0]->e = new b();
$a->b->c[0]->e->f = new a();
2017-04-30 18:38:55 +02:00
$a = [$a];
file_put_contents('test', serialize($a));
var_dump(serialize($a), $a);
var_dump(unserialize(file_get_contents('testb')));