Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56495 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85305 invoked from network); 23 Nov 2011 09:58:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 09:58:33 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:51865] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 73/B6-45113-8C3CCCE4 for ; Wed, 23 Nov 2011 04:58:32 -0500 Received: by qyk33 with SMTP id 33so1037400qyk.29 for ; Wed, 23 Nov 2011 01:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kz9Y7SFFSkwIw5p4C5HcxukWgs5w21mGablJShrgHWw=; b=V3AtqKa9k0wKKhNZl3p24hSv4ER3PyRiZw5D0seIWHjdo30gybjlXgT+dei46lUwgs v5pmKjl5yMPZSh7WVVOaR+UbAV7ZyltDrVUlGvnhNsGHj5Jh6XaPqcX4/xCjIydzUNYh rl/UCQuhB2AWYPTsBdY8w8TWAH2c2yhSuMbp0= MIME-Version: 1.0 Received: by 10.229.227.202 with SMTP id jb10mr2594676qcb.72.1322042309644; Wed, 23 Nov 2011 01:58:29 -0800 (PST) Received: by 10.229.38.134 with HTTP; Wed, 23 Nov 2011 01:58:29 -0800 (PST) In-Reply-To: <4ECCC227.9000803@lsces.co.uk> References: <20111123015008.GA12933@panix.com> <20111123023108.GA172@panix.com> <4ECCB549.904@lsces.co.uk> <4ECCC227.9000803@lsces.co.uk> Date: Wed, 23 Nov 2011 10:58:29 +0100 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: multipart/alternative; boundary=0016363b8ec23e91c104b263f606 Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: tyra3l@gmail.com (Ferenc Kovacs) --0016363b8ec23e91c104b263f606 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Nov 23, 2011 at 10:51 AM, Lester Caine wrote: > Ferenc Kovacs wrote: > >> some clarification: >> in the test script, Daniel declared $arr as: >> $arr =3D array('exists' =3D> 'foo'); >> so when he tests >> $arr['exists']['non_existent'] >> PHP will see that $arr['exists'] is a string, and it will convert the >> 'non_existent' index to int(0) and that will return the same >> as $arr['exists'][0]: 'f' >> If he would have defined $arr['exists'] as an array, then the code would >> work as >> he expected, empty would returned true for $arr['exists']['non_existent'= ] >> > > The bit I am missing here is the statement that $arr =3D array ... has NO= T > created an array with an element ['exists'] yes it did, but ['exists'] wasn't defined as an array, but as a string. > ... I suspect that this is perhaps where the code *I* am looking at is > breaking down ... how SHOULD you define the array so that it is an array? > So that $family =3D array ( 'fam1' =3D> 'JONES' ); is the base for the JO= NES > family rather than simply a string. All of this USED to be simple, but it > seems to be getting so cryptic that this is what is causing the trouble := ( I think you just need a coffee. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --0016363b8ec23e91c104b263f606--