ID: 28787 User updated by: frzzman at yahoo dot com Reported By: frzzman at yahoo dot com Status: Open Bug Type: Feature/Change Request Operating System: win32 - Windows Server 2003 Ent PHP Version: 5.0.0RC3 New Comment:
I forgot to include that these function should return the modifier of the member too, to know that public final static AFunction() is a function that can be statically access by public and it doesn't want to be overriden is very useful too. Previous Comments: ------------------------------------------------------------------------ [2004-06-15 07:28:26] frzzman at yahoo dot com Description: ------------ When get_class_vars() return every properties of the class, private and protected members are mark with [Class Name] and * before its name, well it better being mark with + or - or # (like UML standard). Also, this function shouldn't return value of the property as private and protected can only be expose in the scope that have access permission. Next, get_class_methods() also return every methods the class have, without any marking method?!?! What's the point doing that if I can't figure out if I can access the class's method or not. I suggest these two function should return all attributes and methods with its access marking. And another function, maybe get_class_vars_value() to expose default value of attributes in the class, this function should return value of accessible attribute, too. Reproduce code: --------------- <?php class ClassA { private $PrivateVar = null; protected $ProtectedVar = null; public $PublicVar = null; private function PrivateFunc() {} protected function ProtectedFunc() {} public function PublicFunc() {} } var_dump(get_class_vars('ClassA')); var_dump(get_class_methods('ClassA')); ?> Expected result: ---------------- array(3) { ["PrivateVar"] => string(1) - [" * ProtectedVar"] => string(1) # ["PublicVar"] => string(1) + } array(3) { ["PrivateFunc"] => string(1) - ["ProtectedFunc"] => string(1) # ["PublicFunc"] => string(1) + } Actual result: -------------- array(3) { [" ClassA PrivateVar"] => NULL [" * ProtectedVar"] => NULL ["PublicVar"] => NULL } array(3) { [0]=> string(11) "PrivateFunc" [1]=> string(13) "ProtectedFunc" [2]=> string(10) "PublicFunc" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28787&edit=1