class myclass {
public $name;
public $address;
private $age;
function SetAge($age) {
$this->age = $age;
}
}
$obj = new myclass;
$obj->name = "John";
$obj->address = "Main Street";
$obj->SetAge(47);
$arr = (array)$obj;
print_r($arr);
?>