- var_dump: documentation ( source)
- serialize: documentation ( source)
<?php
class Ab implements Serializable{
protected $x;
function __construct()
{
$this->x = 'val';
}
public function serialize()
{
throw new Exception('Can\'t serialize ');
}
public function unserialize($str)
{
throw new Exception('Can\'t serialize ');
}
}
try{
$tmp = serialize(new Ab());
}catch(Exception $e){
var_dump($e);
}