ID: 30408 Updated by: [EMAIL PROTECTED] Reported By: guth at fiifo dot u-psud dot fr -Status: Open +Status: Feedback Bug Type: Class/Object related Operating System: Linux PHP Version: 5.0.2 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2004-10-12 11:03:26] guth at fiifo dot u-psud dot fr Description: ------------ I got another strange behaviour with classes functions. get_class_methods(Object $obj) returns private and protected methods. get_class_vars(string $class) returns private and protected properties. However, get_object_vars() doesn't. This method takes an Object parameter and I think that its behaviour should be the same as get_class_methods(Object $obj). This bug is "related" to bug #30381. Reproduce code: --------------- <?php class A { protected $plip; private function run() { } } class B extends A { } class hariCow extends B { private $plop = 'beta'; } $db = new hariCow; var_dump(get_class_vars('hariCow')); var_dump(get_object_vars($db)); var_dump(get_class_methods($db)); echo $db->run(); ?> Expected result: ---------------- array(2) { ["plop"]=> string(4) "beta" ["plip"]=> NULL } array(2) { ["plop"] => ... ["plip"] => ... } array(1) { [0]=> string(3) "run" } Actual result: -------------- array(2) { ["plop"]=> string(4) "beta" ["plip"]=> NULL } array(0) { } array(1) { [0]=> string(3) "run" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30408&edit=1
