ID:               32057
 Updated by:       [EMAIL PROTECTED]
 Reported By:      eli dot hen at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Arrays related
 Operating System: unix / windows
 PHP Version:      5.0.2
 New Comment:

Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

Tell the Zend guys... 


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

[2005-02-21 21:59:57] eli dot hen at gmail dot com

Description:
------------
Hi,

It seems that + operator on arrays seems to be incorrect with Zend
Optimizer (tested on v2.5.7 using PHP5.0.2 on CGI/CLI mode rather on
unix or windows platforms).

The manual regarding array + operator only talks about adding array
*variables*, and not the form in the example above.

Please note that if you assign the value of array(..)+$a into another
variable (not $a), then you get the expected result.

-thanks, Eli


Reproduce code:
---------------
<?php
   $a=array('b'=>2,'c'=>3);
   $a=array('a'=>1)+$a;
   var_dump($a);
?>


Expected result:
----------------
array(3) {
  ["a"]=>
  int(1)
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
}


Actual result:
--------------
array(3) {
  ["b"]=>
  int(2)
  ["c"]=>
  int(3)
  ["a"]=>
  int(1)
}



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


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

Reply via email to