ID: 27641
Updated by: [EMAIL PROTECTED]
Reported By: brad at info-link dot net
-Status: Open
+Status: Assigned
-Bug Type: PHP options/info functions
+Bug Type: Zend Engine 2 problem
Operating System: RedHat Linux 7.3
PHP Version: 5.0.0RC1
-Assigned To:
+Assigned To: andi
New Comment:
Reclassify as Zend Engine 2 problem, and assigning to Andi.
Previous Comments:
------------------------------------------------------------------------
[2004-03-18 18:04:07] brad at info-link dot net
Description:
------------
When zend.ze1_compatibility_mode = On, the functions such as print_r
and get_object_vars seem to always return the values from the _class_
variables, NOT the current _object_ variable values. The problem
doesn't seem to exist with zend.ze1_compatibility_mode = Off.
Reproduce code:
---------------
<?php
class A {
var $a = "Default for A";
var $b = "Default for B";
function __construct($a, $b) {
$this->a = $a;
$this->b = $b;
}
function A() {
$args = func_get_args();
call_user_func_array(Array(&$this, '__construct'), $args);
}
}
$t = new A("New A", "New B");
print_r($t);
print_r(get_class_vars(get_class($t)));
print_r(get_object_vars($t));
?>
Expected result:
----------------
a Object
(
[a] => New A
[b] => New B
)
Array
(
[a] => Default for A
[b] => Default for B
)
Array
(
[a] => New A
[b] => New B
)
Actual result:
--------------
A Object
(
[a] => Default for A
[b] => Default for B
)
Array
(
[a] => Default for A
[b] => Default for B
)
Array
(
[a] => Default for A
[b] => Default for B
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27641&edit=1