Doc #62512 [Opn]: Error about array operators documentation
Edit report at https://bugs.php.net/bug.php?id=62512&edit=1
ID: 62512
User updated by: php at maerdo dot com
Reported by: php at maerdo dot com
Summary: Error about array operators documentation
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: n/a
PHP Version: 5.4.4
Block user comment: N
Private report: N
New Comment:
URL : http://www.php.net/manual/fr/language.operators.array.php
Previous Comments:
------------------------------------------------------------------------
[2012-07-08 20:38:21] php at maerdo dot com
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 this bug report at https://bugs.php.net/bug.php?id=62512&edit=1
Thread (4 messages)