- var_dump: documentation ( source)
- get_class_vars: documentation ( source)
<?php
class Mother {
function getProperties(){
return get_class_vars(get_class($this));
}
}
class Child extends Mother{
protected $one = 1;
protected $two = 2;
}
$c = new Child;
var_dump($c->getProperties());