- unserialize: documentation ( source)
- print_r: documentation ( source)
- serialize: documentation ( source)
<?php
class Test {
private $one = 1;
private $two = 2;
private $three = 3;
public function test() {}
public function __sleep()
{
return ['one'];
}
}
$t = new Test;
$b = (string) serialize($t);
$t = null;
echo $b;
echo '<pre>';
print_r(unserialize($b));
?>