ID:               26441
 Updated by:       [EMAIL PROTECTED]
 Reported By:      chernyshevsky at hotmail dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2004-03-30
 Assigned To:      andi
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2004-04-07 11:19:09] [EMAIL PROTECTED]

Andi, you decide if this is docu prob or real bug.. :)



------------------------------------------------------------------------

[2004-04-01 01:02:14] [EMAIL PROTECTED]

Okay, but it still shouldn't act screwy when you do 

return that value. It should just ignore the return 

value of __set().

------------------------------------------------------------------------

[2004-03-31 23:12:24] chernyshevsky at hotmail dot com

I think it was marked bogus because you don't actually need to return
from __set(). The engine will call __get() when you have something like
$a = $object->prop = "Hello".

------------------------------------------------------------------------

[2003-11-28 01:13:50] chernyshevsky at hotmail dot com

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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26441&edit=1

Reply via email to