ID:               29923
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bugs dot php dot net at chsc dot dk
-Status:           Open
+Status:           Feedback
 Bug Type:         Zend Engine 2 problem
 Operating System: Linux
 PHP Version:      5.0.1
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip


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

[2004-08-31 19:24:44] bugs dot php dot net at chsc dot dk

Description:
------------
When called from inside a class method, $this->foo += 2 does not
increment the variable.

$this->foo = $this->foo + 2 appears to work, though.

This looks related to bug 27798.

Reproduce code:
---------------
<?php

class foo {
    var $bar = 1;

    function baz() {
        $this->bar += 2;
        var_dump($this->bar);
        var_dump(get_object_vars($this));
    }
}

$f = new foo();
$f->baz();

$f->bar += 4;
var_dump($f->bar);

?>

Expected result:
----------------
int(3)
array(1) {
  ["bar"]=>
  int(3)
}
int(7)


Actual result:
--------------
int(1)
array(2) {
  ["bar"]=>
  int(1)
  [0]=>
  int(2)
}
int(5)



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


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

Reply via email to