ID: 27798
User updated by: ricardo at ish dot com dot br
Reported By: ricardo at ish dot com dot br
-Status: Bogus
+Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Windows XP
PHP Version: 5.0.0RC1
New Comment:
Here is the sample code:
<?php
class Foo {
public $var1;
private $var2;
function __construct() {
$this->var1 = 'A';
$this->var2 = 'B';
}
public function dumpVars() {
print_r(get_object_vars($this));
}
}
?>
<pre>
<?php
$myFoo = new Foo();
echo "My VARS:<br>\n";
$myFoo->dumpVars();
?>
</pre>
Here is the behavior:
=====================
My VARS:
Array
(
[var1] => A
)
Here is the expected Behavior:
==============================
My VARS:
Array
(
[var1] => A
[var2] => B
)
My opinion about it:
====================
Since the function get_object_vars is being called inside the class, it
should have access to all PPP types, shouldn't it? (this example above
is a dummy one, but it illustrates the problem quite well).
Sorry about the delay of my reply.
Previous Comments:
------------------------------------------------------------------------
[2004-04-07 08:57:10] ricardo at ish dot com dot br
Well, as pointed by your observation, it should work if i call
get_object_vars in a method inside the own class, right?
well, it will also fail. :)
------------------------------------------------------------------------
[2004-04-07 04:39:06] [EMAIL PROTECTED]
That's expected behaviour..(what would the use of protected/private be
if you can get access to them anywhere?)
(if you disagree, give an example..and not a reference to unrelated bug
report)
------------------------------------------------------------------------
[2004-03-31 06:56:14] ricardo at ish dot com dot br
Description:
------------
It seems to me that Bug #26010 is hauting us again. I can't get an
useful result from get_object_vars($obj), unless its var are declared
as public.
Wasn't it supposed to be fixed on CSV since November, 10th, 2003?
Thanks
Ricardo
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27798&edit=1