Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39223 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84107 invoked from network); 23 Jul 2008 12:11:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2008 12:11:15 -0000 X-Host-Fingerprint: 84.75.132.140 84-75-132-140.dclient.hispeed.ch Received: from [84.75.132.140] ([84.75.132.140:23453] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/5D-12534-2EF17884 for ; Wed, 23 Jul 2008 08:11:14 -0400 Message-ID: <18.5D.12534.2EF17884@pb1.pair.com> To: internals@lists.php.net Date: Wed, 23 Jul 2008 14:11:08 +0200 User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 References: <01b401c8ec13$28cd3510$0201a8c0@pc1> In-Reply-To: <01b401c8ec13$28cd3510$0201a8c0@pc1> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 84.75.132.140 Subject: Re: [PATCH] New functions: array_replace[_recursive] From: cschneid@cschneid.com (Christian Schneider) Matt Wilmas wrote: > array_replace() is like the + operator applied to arrays, except that it > WILL overwrite ("replace") existing entries. Excuse my ignorance but what's the difference between $array = array_replace($array1, $array2); and $array = $array2 + $array1; apart from different order of the entries in the resulting array? > array_replace_recursive() will do the same except that it becomes > recursive only when both the destination and source entries are > arrays, otherwise the new source entry still replaces any existing > one. Hmm, generic enough to be included? - Chris