cvs: phpdoc /en/reference/classobj/functions get-object-vars.xml

From: Date: Fri, 18 Apr 2008 22:02:08 +0000
Subject: cvs: phpdoc /en/reference/classobj/functions get-object-vars.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1537@lists.php.net to get a copy of this message
felipe Fri Apr 18 22:02:08 2008 UTC Modified files: /phpdoc/en/reference/classobj/functions get-object-vars.xml Log: - Added information about the visibility (reported by fbn79@libero.it) - Simplify example http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/classobj/functions/get-object-vars.xml?r1=1.11&r2=1.12&diff_format=u Index: phpdoc/en/reference/classobj/functions/get-object-vars.xml diff -u phpdoc/en/reference/classobj/functions/get-object-vars.xml:1.11 phpdoc/en/reference/classobj/functions/get-object-vars.xml:1.12 --- phpdoc/en/reference/classobj/functions/get-object-vars.xml:1.11 Wed Jun 20 22:24:16 2007 +++ phpdoc/en/reference/classobj/functions/get-object-vars.xml Fri Apr 18 22:02:07 2008 @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <refentry xml:id="function.get-object-vars" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>get_object_vars</refname> - <refpurpose>Gets the properties of the given object</refpurpose> + <refpurpose>Gets the public properties of the given object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -12,7 +12,7 @@ <methodparam><type>object</type><parameter>object</parameter></methodparam> </methodsynopsis> <para> - Gets the properties of the given <parameter>object</parameter>. + Gets the public properties of the given <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> @@ -33,7 +33,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns an associative array of defined object properties for the + Returns an associative array of defined object public properties for the specified <parameter>object</parameter>. If a property have not been assigned a value, it will be returned with a &null; value. </para> @@ -71,35 +71,17 @@ <programlisting role="php"> <![CDATA[ <?php -class Point2D { - var $x, $y; - var $label; - function Point2D($x, $y) - { - $this->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 @@ &example.outputs; <screen> <![CDATA[ - Array - ( - [x] => 1.233 - [y] => 3.445 - [label] => - ) - - Array - ( - [x] => 1.233 - [y] => 3.445 - [label] => point #1 - ) +array(2) { + ["b"]=> + int(1) + ["c"]=> + NULL +} ]]> </screen> </example>

« previous php.doc.cvs (#1537) next »