diff --git a/reference/classobj/functions/get-object-vars.xml b/reference/classobj/functions/get-object-vars.xml index 80fad981b6..7648c16f07 100644 --- a/reference/classobj/functions/get-object-vars.xml +++ b/reference/classobj/functions/get-object-vars.xml @@ -1,9 +1,9 @@ - + get_object_vars - Gets the properties of the given object + Gets the public properties of the given object &reftitle.description; @@ -12,7 +12,7 @@ objectobject - Gets the properties of the given object. + Gets the public properties of the given object. @@ -33,7 +33,7 @@ &reftitle.returnvalues; - Returns an associative array of defined object properties for the + Returns an associative array of defined object public properties for the specified object. If a property have not been assigned a value, it will be returned with a &null; value. @@ -71,35 +71,17 @@ x = $x; - $this->y = $y; - } - - function setLabel($label) - { - $this->label = $label; - } - - function getPoint() - { - return array("x" => $this->x, - "y" => $this->y, - "label" => $this->label); - } +class foo { + private $a; + public $b = 1; + public $c; + private $d; + static $e; } -// "$label" is declared but not defined -$p1 = new Point2D(1.233, 3.445); -print_r(get_object_vars($p1)); - -$p1->setLabel("point #1"); -print_r(get_object_vars($p1)); +$test = new foo; +var_dump(get_object_vars($test)); ?> ]]> @@ -107,19 +89,12 @@ print_r(get_object_vars($p1)); &example.outputs; 1.233 - [y] => 3.445 - [label] => - ) - - Array - ( - [x] => 1.233 - [y] => 3.445 - [label] => point #1 - ) +array(2) { + ["b"]=> + int(1) + ["c"]=> + NULL +} ]]>