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

From: Date: Mon, 25 May 2009 18:02:56 +0000
Subject: cvs: phpdoc /en/reference/classobj/functions get-class-vars.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4061@lists.php.net to get a copy of this message
kalle Mon May 25 18:02:56 2009 UTC Modified files: /phpdoc/en/reference/classobj/functions get-class-vars.xml Log: Fixed bug #46795 (Documentation for get_class_vars return value is inconsistent ("public")) http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/classobj/functions/get-class-vars.xml?r1=1.12&r2=1.13&diff_format=u Index: phpdoc/en/reference/classobj/functions/get-class-vars.xml diff -u phpdoc/en/reference/classobj/functions/get-class-vars.xml:1.12 phpdoc/en/reference/classobj/functions/get-class-vars.xml:1.13 --- phpdoc/en/reference/classobj/functions/get-class-vars.xml:1.12 Wed Jun 20 22:24:16 2007 +++ phpdoc/en/reference/classobj/functions/get-class-vars.xml Mon May 25 18:02:56 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.12 $ --> +<!-- $Revision: 1.13 $ --> <refentry xml:id="function.get-class-vars" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>get_class_vars</refname> @@ -51,6 +51,29 @@ </thead> <tbody> <row> + <entry>5.0.3</entry> + <entry> + Depending on the scope, <function>get_class_vars</function> will + only return the properties that can be accessed from the current + scope. + </entry> + </row> + <row> + <entry>5.0.2</entry> + <entry> + Calling <function>get_class_vars</function> will now expose + all the properties as an array, unlike previous behaviour where + protected and private properties were prefixed with nul bytes. + </entry> + </row> + <row> + <entry>5.0.1</entry> + <entry> + Calling <function>get_class_vars</function> will expose all + properties, as when converting an object to a class. + </entry> + </row> + <row> <entry>Prior to 4.2.0</entry> <entry> Uninitialized class variables will not be reported by @@ -114,6 +137,52 @@ </screen> </example> </para> + <para> + <example> + <title><function>get_class_vars</function> and scoping behaviour</title> + <programlisting role="php"> +<![CDATA[ +<?php +function format($array) +{ + return implode('|', array_keys($array)) . "\r\n"; +} + +class TestCase +{ + public $a = 1; + protected $b = 2; + private $c = 3; + + public static function expose() + { + echo format(get_class_vars(__CLASS__)); + } +} + +TestCase::expose(); +echo format(get_class_vars('TestCase')); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +// 5.0.0 +a| * b| TestCase c +a| * b| TestCase c + +// 5.0.1 - 5.0.2 +a|b|c +a|b|c + +// 5.0.3 + +a|b|c +a +]]> + </screen> + </example> + </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso;

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