- print_r: documentation ( source)
- get_object_vars: documentation ( source)
<?php
class test {
private $a;
private $b;
function __construct()
{
$this->a = 'AAA';
$this->b = 2;
}
}
$test = new test();
echo $test;
print_r(get_object_vars($test));