- serialize: documentation ( source)
<?php
class A
{
public $a = 5;
public $b = 'b';
public $c = null;
protected $d = "d";
private $e = "eeeee";
public function __construct()
{
$this->c = new \StdClass();
$this->c->a = 5;
$this->c->b = "q";
}
}
echo serialize(new A);