- print_r: documentation ( source)
<?php
class Test
{
private $a = 0;
protected $b = true;
public $c = 'hello';
}
class Another extends Test
{
private $a = 1;
protected $b = false;
public $d ='wow';
}
$obj = new Another();
$data = (array) $obj;
$new = (object) $data;
print_r($data);
print_r($new);