Re: Re: Behaviour of $array1 + $array2
| From: | Yasuo Ohgaki | Date: | Fri, 11 Jan 2002 04:28:32 +0000 |
| Subject: | Re: Re: Behaviour of $array1 + $array2 | ||
| References: | 1 2 3 4 | Groups: | php.dev php.doc |
| Request: | Send a blank email to php-dev+get-76578@lists.php.net to get a copy of this message | ||
Markus Fischer wrote:
On Thu, Jan 10, 2002 at 05:58:28PM -0700, Zak Greant wrote :I think it should be documented, unless "+" is going to be depreciated. (I hope it's not ;) -- Yasuo OhgakiOn 2002-10-01 17:33, Yasuo Ohgaki wrote:Markus Fischer wrote:Also, there have been discussions on Dev about this issue before. Might be a bit tough to find though. :)Can someone point me where the following behaviour is documented: $ php -q <? $foo = array(27 => 'Ene'); $bar = array(-1 => 'Mene');I guess it's not. There is note explains this behavior. Accoding to the note, "PHP Developer's Cookbook claims (p. 87 and sort of on p. 108) that '+' is syntactic sugar for array_merge."$baz = $foo + $bar;var_dump($baz); ?> array(2) {[27]=> string(3) "Ene" [-1]=> string(4) "Mene"} cheers - MarkusHmm .. well, at least, it should be clearly documented.