Doc #62512 [NEW]: Error about array operators documentation
| From: | php at maerdo dot com | Date: | Sun, 08 Jul 2012 20:38:21 +0000 |
| Subject: | Doc #62512 [NEW]: Error about array operators documentation | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8544@lists.php.net to get a copy of this message | ||
From: php at maerdo dot com
Operating system: n/a
PHP version: 5.4.4
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Error about array operators documentation
Description:
------------
This page inform that the addition of two arrays add datas of left array to
datas of the right array :
" L'opérateur + retourne le tableau de droite auquel sont ajoutés les
éléments du tableau de gauche."
After test it, i note the behavior is opposite.
The addition of these arrays result in the addition of datas of the right
array to datas of the left array.
<?php
$array1=['a'=>1,'b'=>2];
$array2=['a'=>'A','B','C'];
var_dump($array1+$array2);
// output
array(4) { ["a"]=> int(1) ["b"]=> int(2) [0]=> string(1) "B"
[1]=>
string(1) "C" }
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=62512&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62512&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62512&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62512&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62512&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62512&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62512&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62512&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62512&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62512&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62512&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62512&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62512&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62512&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62512&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62512&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62512&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62512&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62512&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62512&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62512&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62512&r=mysqlcfg