#30659 [Com]: get_class_vars() works incorrect
| From: | aaron at visualprose dot com | Date: | Mon, 08 Nov 2004 01:03:12 +0000 |
| Subject: | #30659 [Com]: get_class_vars() works incorrect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68791@lists.php.net to get a copy of this message | ||
ID: 30659
Comment by: aaron at visualprose dot com
Reported By: mx at tut dot by
Status: Feedback
Bug Type: Class/Object related
Operating System: *
PHP Version: 5CVS-2004-11-02 (dev)
New Comment:
You can download a script that will reproduce this bug
here: http://visualprose.com/inheritance-bug.php.gz
. I
am experiencing this on Mac OS X 10.3.5 (client and
server) under PHP 5.0.2. This bug wasn't occuring under
PHP 5.0.0. Let me know if you need more info.
<:> Aaron Jensen
<:> aaron@visualprose.com
Previous Comments:
------------------------------------------------------------------------
[2004-11-03 01:01:15] helly@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
One you get correct Acutal/Expected info come back.
------------------------------------------------------------------------
[2004-11-02 12:45:27] mx at tut dot by
Description:
------------
behavior of get_class_vars() changed between 13 Sep 2004 and 22 Oct
2004. Is it correct?
Reproduce code:
---------------
<?
class A {
private $user;
protected $group;
public $world;
function dump() {
print_r(get_object_vars($this));
}
}
class B extends A {
public $zoo;
}
$a = new B();
print_r(get_class_vars(get_class($a)));
print_r(get_object_vars($a));
$a->dump();
?>
Expected result:
----------------
Array ( [zoo] => [group] => [world] => )
Array ( [zoo] => [group] => [world] => )
Array ( [zoo] => [group] => [world] => )
Actual result:
--------------
Array ( [zoo] => [world] => )
Array ( [zoo] => [world] => )
Array ( [zoo] => [group] => [world] => )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30659&edit=1