Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56590 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62604 invoked from network); 24 Nov 2011 21:31:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2011 21:31:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:43093] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/C5-26290-4B7BECE4 for ; Thu, 24 Nov 2011 16:31:37 -0500 Received: by ghbg16 with SMTP id g16so51956ghb.29 for ; Thu, 24 Nov 2011 13:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=cGGe8m+1SMZ4IFkgpsdF2m5FCfikJZ0TvfhvtQeaojw=; b=kUzPAy5V+eQpdq66wutjvDRxaKx0mIcuwTic3IeeKG/j8JZthi1WxSe2Eit2AA0Fym Ka1fvU95rcKFrNUlOTsSLkAHEpjGb3HQ/Wl+kOc588uRy0SfA8k+78+QnbhzMgMkqfim A9rZts1ZFIfTEbI+hchlJmTajACdFI6lsj9ws= Received: by 10.147.116.9 with SMTP id t9mr6103143yam.5.1322170287063; Thu, 24 Nov 2011 13:31:27 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.100.127.18 with HTTP; Thu, 24 Nov 2011 13:30:46 -0800 (PST) In-Reply-To: References: <20111123015008.GA12933@panix.com> Date: Fri, 25 Nov 2011 06:30:46 +0900 X-Google-Sender-Auth: zJvUuei1g_tGrFR67MbKuSqB9eQ Message-ID: To: RQuadling@gmail.com Cc: Daniel Convissor , PHP Internals List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi, 2011/11/24 Richard Quadling : > On 23 November 2011 01:50, Daniel Convissor > wrote: >> Hi Folks: >> >> I just stumbled upon a regression in 5.4. =A0In an array, a sub-sub-key = of >> an existing key is now returning a letter of the value indexed by the >> main key. =A0I'm raising it here so it doesn't get lost. >> >> https://bugs.php.net/bug.php?id=3D60362 >> >> Thanks, >> >> --Dan > > I've just ran the code for the bug through all the V5 releases/betas/alph= as/RCs. > > V5.0.0 to V5.0.2 > > BEHAVIOR CHANGED: sub-key 'non_existent' is not set. > expected: sub-key 1 is set: string(1) "o" > ------------------- > good: sub-sub-key 'sub_sub' is not set. > good: sub-sub-key 0 is not set. > ------------------- > BEHAVIOR CHANGED: sub-key 'non_existent' is empty. > expected: sub-key 1 is NOT empty: string(1) "o" > ------------------- > good: sub-sub-key 'sub_sub' is empty. > good: sub-sub-key 0 is empty. > > > > V5.0.3 (don't have) > > > > V5.0.4 to V5.3.9RC2-dev (as at around 10am GMT on the 23rd Nov 2011). > expected: sub-key 'non_existent' is set: string(1) "f" > expected: sub-key 1 is set: string(1) "o" > ------------------- > good: sub-sub-key 'sub_sub' is not set. > good: sub-sub-key 0 is not set. > ------------------- > expected: sub-key 'non_existent' is not empty: string(1) "f" > expected: sub-key 1 is NOT empty: string(1) "o" > ------------------- > good: sub-sub-key 'sub_sub' is empty. > good: sub-sub-key 0 is empty. > > > > V5.4+ (betas and RCs) > expected: sub-key 'non_existent' is set: string(1) "f" > expected: sub-key 1 is set: string(1) "o" > ------------------- > BEHAVIOR CHANGED: sub-key 'sub_sub' is set: string(1) "f" > BEHAVIOR CHANGED: sub-sub-key 0 is set: string(1) "o" > ------------------- > expected: sub-key 'non_existent' is not empty: string(1) "f" > expected: sub-key 1 is NOT empty: string(1) "o" > ------------------- > BEHAVIOR CHANGED: sub-sub-key 'sub_sub' is not empty: string(1) "f" > BEHAVIOR CHANGED: sub-sub-key 0 is not empty: string(1) "o" > > > > So there was a previous bug fix in V5.0.2 (maybe 5.0.3). > > So, the whole type juggling point here is mute. It has been that way > for a very long time. I just didn't realise it. > > And if that is a valid result > (var_dump($arr['exists']['non_existent']) =3D=3D=3D 'f') - which it now i= s > obviously is, then the change in V5.4 is certainly a bug fix. > > But, it is a significant enough issue that warrants a decent amount of > documentation. > Nice effort for checking PHP 5.0. I guess this difference comes from string offset access method change introduced some where in 5.x. Wasn't it supposed to access string offset like