Seva's notes

Wisdom, Awareness, Responsibility :)

PHP: array_merge versus array union operator (+)

with 2 comments

Written by Seva

2010-07-22 (July 22) at 11:10:52

Posted in development, php

2 Responses

Subscribe to comments with RSS.

  1. It should also be mentioned that using the array union operator also treats numeric keys (i.e. of a non-associative array) the same as associative keys, which is somewhat counter-intuitive.

    mdpatrick

    2012-03-04 (March 4) at 07:54:20

    • Not at all. Array union is well defined, while array_merge is the bad magician.

      Seva

      2012-03-05 (March 5) at 02:24:48


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: