ID: 26691
Updated by: [EMAIL PROTECTED]
Reported By: redeye at erisx dot de
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5.0.0b2 (beta2)
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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