- unserialize: documentation ( source)
- serialize: documentation ( source)
<?php
class foo
{
public $throw_exception = false;
function __construct()
{
echo "construct called\n";
if ($this->throw_exception == true)
{
throw new Exception();
}
else
{
$this->throw->exception=true;
}
}
}
$a = new foo;
$x = serialize($a);
$y = unserialize($x);