#26691 [Fbk->NoF]: Incorrect behaviour of PPP using get_class_methods([obj]);

From: Date: Wed, 07 Jan 2004 01:52:31 +0000
Subject: #26691 [Fbk->NoF]: Incorrect behaviour of PPP using get_class_methods([obj]);
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-52901@lists.php.net to get a copy of this message
ID: 26691 Updated by: sniper@php.net Reported By: redeye at erisx dot de -Status: Feedback +Status: No Feedback Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5.0.0b2 (beta2) New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. Previous Comments: ------------------------------------------------------------------------ [2004-01-01 21:07:14] sniper@php.net 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 ------------------------------------------------------------------------ [2003-12-28 18:23:04] andrey@php.net Well, there are more inconsistencies - like print_r() which can dump values of protected/private values (var_dump() does not do that). print_r() relies on internals of Zend and this is why it prints the info about private/protected vars. Back to the current topic, imo it's not a problem that you can see what's behind since private/protected methods cannot be called outside of the $this context. ------------------------------------------------------------------------ [2003-12-22 08:42:38] redeye at erisx dot de Description: ------------ Calling get_class_methods([obj]); on an object returns next to public methods it's private and protected methods. I guess those methods should only be returned when calling get_class_methods($this); within an object. Reproduce code: --------------- <pre><?php class test { public function pub_function() { // some code } private function priv_function() { // some code } } $test = new test; $arry = get_class_methods($test); foreach ( $arry AS $n => $method_name ) { echo $n." -> ".$method_name."\n"; } ?></pre> Expected result: ---------------- empty page :-) Actual result: -------------- 0 -> pub_function 1 -> priv_function ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26691&edit=1

« previous php.bugs (#52901) next »