Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56575 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3903 invoked from network); 24 Nov 2011 12:33:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2011 12:33:41 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:55012] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/D8-46656-2A93ECE4 for ; Thu, 24 Nov 2011 07:33:40 -0500 Received: by ywt2 with SMTP id 2so2008263ywt.29 for ; Thu, 24 Nov 2011 04:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=SQ/rIpCT6TvqnFRz02ivQaImsDycHF00660vsA8Wq/A=; b=iE8Jt5N1iU7fV7g/3UHOPgsftUx1jSysm8PzjeoUMGVDNnlXyezOeBS0lZu3IZlUUd uEOkUDdcjgiS87KuLexg76rFV/oi88o3fKLQoBPVweA5Bv2MYptwFO3GOtCvJF9wjyVT 0nPXaSg/oWB+tl6B3jRlDx06LacdtC3a4BCiw= Received: by 10.182.139.4 with SMTP id qu4mr9450041obb.13.1322138015231; Thu, 24 Nov 2011 04:33:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.42.226 with HTTP; Thu, 24 Nov 2011 04:33:14 -0800 (PST) Reply-To: RQuadling@GMail.com In-Reply-To: <20111123015008.GA12933@panix.com> References: <20111123015008.GA12933@panix.com> Date: Thu, 24 Nov 2011 12:33:14 +0000 Message-ID: To: Daniel Convissor Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: rquadling@gmail.com (Richard Quadling) On 23 November 2011 01:50, Daniel Convissor wrote: > Hi Folks: > > I just stumbled upon a regression in 5.4. =C2=A0In an array, a sub-sub-ke= y of > an existing key is now returning a letter of the value indexed by the > main key. =C2=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/alphas= /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 is 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. --=20 Richard Quadling Twitter : EE : Zend : PHPDoc : Fantasy Shopper @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea=C2=A0: fan.sh/6/370