Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40662 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98380 invoked from network); 24 Sep 2008 12:09:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2008 12:09:48 -0000 Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.178 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.178 mho-01-bos.mailhop.org Received: from [63.208.196.178] ([63.208.196.178:57887] helo=mho-01-bos.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/C8-52685-A0E2AD84 for ; Wed, 24 Sep 2008 08:09:46 -0400 Received: from a88-112-30-186.elisa-laajakaista.fi ([88.112.30.186] helo=localhost.localdomain) by mho-01-bos.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KiTBf-00023D-Qe; Wed, 24 Sep 2008 12:09:44 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 88.112.30.186 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+GsnsBa44aWQTPO8PFAnti6estycTZImI= Message-ID: <48DA2E03.5090408@sci.fi> Date: Wed, 24 Sep 2008 15:09:39 +0300 Reply-To: jani.taskinen@iki.fi User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: troels knak-nielsen CC: php-dev List References: <98b8086f0809240504v337b82cau302e9f47a793e466@mail.gmail.com> In-Reply-To: <98b8086f0809240504v337b82cau302e9f47a793e466@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Associative array syntax question? From: jani.taskinen@sci.fi (Jani Taskinen) troels knak-nielsen wrote: > I just realised that his is valid PHP: > > var_dump( > array( > 'foo' => 42, > 'foo' => 53)); > > Producing the following output: > array(1) { > ["foo"]=> > int(53) > } > > I can anticipate that there may be practical reasons for this > "feature", but I can't think up any scenario, where it wouldn't be a > programming error to statically declare an associative array with the > same key multiple times. Is this a bug or a known quirk? Should I file > a bug-report on it? Expected behaviour. --Jani