|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-08 13:25 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 15:00:01 2025 UTC |
Description: ------------ Copying an array returned by __get to other array returned by __get from other object gives wrong effect. Reproduce code: --------------- class test { private $variables = array(); public function & __get($name) { return $this->variables[$name]; } public function __set($name, $value) { $this->variables[$name] = $value; } } $test1 = new test; $test1->data['sth1'] = 'sth1'; $test1->data['sth2'] = 'sth2'; $test2 = new test; $test2->data['rewritten'] = $test1->data; echo($test2->data['rewritten']['sth1']); Expected result: ---------------- I expected that on the screen I see this text: sth1 On PHP 5.1.x it works properly. Actual result: -------------- On the screen I see text: Array