From 916384321d193e168578a65817fb3e3c3eb59fad Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Fri, 18 Apr 2008 22:02:07 +0000 Subject: [PATCH] - Added information about the visibility (reported by fbn79@libero.it) - Simplify example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@257856 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../classobj/functions/get-object-vars.xml | 61 ++++++------------- 1 file changed, 18 insertions(+), 43 deletions(-) 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 +} ]]>