Some may find this useful.
<?php
function getClassProperties($className, $types='public'){
$ref = new ReflectionClass($className);
$props = $ref->getProperties();
$props_arr = array();
foreach($props as $prop){
$f = $prop->getName();
if($prop->isPublic() and (stripos($types, 'public') === FALSE)) continue;
if($prop->isPrivate() and (stripos($types, 'private') === FALSE)) continue;
if($prop->isProtected() and (stripos($types, 'protected') === FALSE)) continue;
if($prop->isStatic() and (stripos($types, 'static') === FALSE)) continue;
$props_arr[$f] = $prop;
}
if($parentClass = $ref->getParentClass()){
$parent_props_arr = getClassProperties($parentClass->getName());if(count($parent_props_arr) > 0)
$props_arr = array_merge($parent_props_arr, $props_arr);
}
return $props_arr;
}
class A{
public $a1;
function abc(){
}
}
class AA extends A{
public $a2;
function edf(){
}
}
class AAA extends AA{
function ghi(){
}
}
$props_arr = getClassProperties('AAA', 'public');var_dump($props_arr);
?>