ID: 36571
Updated by: [EMAIL PROTECTED]
Reported By: cid73 at 163 dot com
-Status: Open
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.1.3RC3
Assigned To: dmitry
New Comment:
$object->a = value;
and
$object->b[] = value;
are completely different things.
For the second line to work __get() must return by reference, but
__get() always returns *by value*.
So this is the expected and correct result.
Previous Comments:
------------------------------------------------------------------------
[2006-08-07 08:10:40] cid73 at 163 dot com
Excuse me, my purpose was obvioursly to create a setter class, and then
after I do:
------------
$o = new Setter($a);
$o->a[0] = 'A';
$o->a[] = 'd';
$o->b{0} = 'h';
print_r($o); // note: it's $o, not $a
---------------
I think the result should now be:
Setter Object
(
[attributes:private] => Array
(
[a] => Array
(
[0] => A
[1] => b
[2] => c
[3] => d
)
[b] => hello
)
)
The old problem was "$a was modified", this problem has been fixed; but
the problem now goes to $o: all the assignments don't work. Let's see
what I get:
Setter Object
(
[attributes:private] => Array
(
[a] => Array
(
[0] => a
[1] => b
[2] => c
)
[b] => Hello
)
)
I tested it with 5.2-dev
------------------------------------------------------------------------
[2006-08-06 16:04:18] [EMAIL PROTECTED]
Yes, I did test it with 5.2-dev.
Array
(
[a] => Array
(
[0] => a
[1] => b
[2] => c
)
[b] => Hello
)
------------------------------------------------------------------------
[2006-08-06 15:54:17] cid73 at 163 dot com
Are you sure it is fixed now? Did you test $o->a and $o->b, or
print_r($o)? :-)
------------------------------------------------------------------------
[2006-08-01 22:49:53] [EMAIL PROTECTED]
Not reproducible with 5.2-CVS.
------------------------------------------------------------------------
[2006-04-12 09:59:05] [EMAIL PROTECTED]
One more overloading bug.
It is unfixable at this moment :(
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/36571
--
Edit this bug report at http://bugs.php.net/?id=36571&edit=1