ID: 27798
User updated by: ricardo at ish dot com dot br
Reported By: ricardo at ish dot com dot br
-Status: Feedback
+Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Windows XP
-PHP Version: 5.0.0RC1
+PHP Version: 5.0.1-dev
New Comment:
I've tried and isn't working yet (and I also get this error message -
phpinfo() is ok and show PHP 5.0.1-dev):
PHP has encountered an Access Violation at 00B4737A
My VARS:
Array
(
[var1] => A
)
HTTP/1.1 500 Server Error Server: Microsoft-IIS/5.1 Date: Tue, 20 Jul
2004 11:51:51 GMT Content-Type: text/html Content-Length: 44
-2147417842 (0x8001010e)
Previous Comments:
------------------------------------------------------------------------
[2004-07-19 16:53:53] [EMAIL PROTECTED]
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
------------------------------------------------------------------------
[2004-04-17 21:30:58] ricardo at ish dot com dot br
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.
------------------------------------------------------------------------
[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