class Catalog extends Table {
private $type;
private $desc;
}
abstract class Table {
public function __toString() {
$vars = get_object_vars();
return implode(', ', $vars);
}
}
<?php
class Catalog extends Table {
private $type;
private $desc;
protected $prot;
public $pub;
protected function getMetods() {
$vars = get_object_vars($this->self);
return array_keys($vars);
}
}
abstract class Table {
public $perPub;
protected $perProt;
private $perPriv;
protected $self;
abstract protected function getMetods();
public function __toString() {
return implode(', ', $this->getMetods());
}
}
$o=new Catalog();
echo (string) $o;
Gets the accessible non-static properties