#31543 [Opn->Bgs]: get_class_vars does not return private & protected variables
ID: 31543
Updated by: jed@php.net
Reported By: du at bestwaytech dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows XP
PHP Version: 5.0.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
http://php.net/get_class_vars
"This function will return an associative array of default *public*
properties of the class."
If I recall, this didn't work in 5.0.2 either.
Previous Comments:
------------------------------------------------------------------------
[2005-01-13 18:29:44] du at bestwaytech dot com
Just confirmed that it works right using PHP 5.0.2 with same settings
------------------------------------------------------------------------
[2005-01-13 18:14:44] du at bestwaytech dot com
Description:
------------
get_class_vars does not return private and protected variables
Using PHP 5.0.3 with IIS under Windows XP Pro SP2
Reproduce code:
---------------
class test {
private $a = "private";
protected $b = "protected";
public $c = "public";
}
print_r(get_class_vars("test"));
Expected result:
----------------
Array
(
[a] => private
[b] => protected
[c] => public
)
Actual result:
--------------
Array
(
[c] => public
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31543&edit=1
Thread (3 messages)