|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-19 02:46 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
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 )