#31543 [Opn]: get_class_vars does not return private & protected variables

From: Date: Thu, 13 Jan 2005 17:29:45 +0000
Subject: #31543 [Opn]: get_class_vars does not return private & protected variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72075@lists.php.net to get a copy of this message
 ID:               31543
 User updated by:  du at bestwaytech dot com
 Reported By:      du at bestwaytech dot com
 Status:           Open
 Bug Type:         Class/Object related
 Operating System: Windows XP
 PHP Version:      5.0.3
 New Comment:

Just confirmed that it works right using PHP 5.0.2 with same settings


Previous Comments:
------------------------------------------------------------------------

[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)

« previous php.bugs (#72075) next »