|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-31 23:12 UTC] chernyshevsky at hotmail dot com
[2004-04-01 01:02 UTC] amt@php.net
[2004-04-07 11:19 UTC] sniper@php.net
[2004-04-09 10:43 UTC] andi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ When __set() returns an element of a member array, it seems to corrupt the array. Works as expected when "return" is removed. Reproduce code: --------------- class Test { var $values; function __construct() { $this->values = array(); } function __set($name, $value) { return $this->values[$name] = $value; } function __get($name) { return $this->values[$name]; } }; $a = new Test(); $a->greeting = "Hello"; echo $a->greeting; Expected result: ---------------- Hello Actual result: -------------- 1