Find the property's scope within class

patrickstar1985

New Member
\[code\]class ParentClass{ public function list() { foreach ($this as $property => $value) { if (is_public($this->$property)) echo 'public: '; else if (is_protected($this->$property)) echo 'protected: '; echo "$property => $value" . PHP_EOL; } }}class ChildClass extends ParentClass{ protected $Size = 4; protected $Type = 4; public $SubT = 1; public $UVal = NULL;}$CC = new ChildClass;$CC->list();\[/code\]
 
Back
Top