Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56555 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64639 invoked from network); 24 Nov 2011 09:16:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Nov 2011 09:16:35 -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:51259] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/D1-46656-07B0ECE4 for ; Thu, 24 Nov 2011 04:16:33 -0500 Received: by qyk33 with SMTP id 33so2101658qyk.29 for ; Thu, 24 Nov 2011 01:16:30 -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=EfOglfkm8EtPE5cKakDRkxnbAw+P3D2sV+QkJwMdEMA=; b=EBE66lmUwuspT1beQ3H+P6xitPho3mMMb2leoRNIrPmXz/YyzSLPWTjG9g1Y3TO3C4 6qkJi+bcJj2zyPuMy7REyfo1CcFrI7r9eJOliz8FWYY8FN7Bi3bAnq2bjjZ5cPDrCjC2 FERlR1Jnb4WC6IToHiJKX4WTk3eI99aOwNaVE= MIME-Version: 1.0 Received: by 10.229.101.93 with SMTP id b29mr3213810qco.110.1322126190450; Thu, 24 Nov 2011 01:16:30 -0800 (PST) Received: by 10.229.38.134 with HTTP; Thu, 24 Nov 2011 01:16:29 -0800 (PST) In-Reply-To: <4ECDAEE5.7020205@gmail.com> References: <20111123015008.GA12933@panix.com> <20111123023108.GA172@panix.com> <4ECCB549.904@lsces.co.uk> <4ECCBC56.3050602@sugarcrm.com> <20111123141408.GA11940@panix.com> <4ECD40E2.1000601@sugarcrm.com> <4ECD48AD.1020207@sugarcrm.com> <4ECD91F4.5040303@gmail.com> <4ECDAEE5.7020205@gmail.com> Date: Thu, 24 Nov 2011 10:16:29 +0100 Message-ID: To: David Muir Cc: Stas Malyshev , Daniel Convissor , Lester Caine , PHP internals Content-Type: multipart/alternative; boundary=001636499237ee184304b2777db8 Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: tyra3l@gmail.com (Ferenc Kovacs) --001636499237ee184304b2777db8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Nov 24, 2011 at 3:41 AM, David Muir wrote: > On 24/11/11 12:44, Ferenc Kovacs wrote: > > > > On Thu, Nov 24, 2011 at 1:38 AM, David Muir wrote: > >> Just to clarify, the changes introduced in 5.4 will result in the >> following: >> >> > >> $string =3D 'foo'; >> $array =3D array( >> 'foo' =3D> array( >> 'bar' =3D> 'baz', >> //expected structure >> //'bar' =3D> array('baz' =3D> array('values')) >> )); >> >> var_dump( >> isset($string['foo']), //true >> isset($string[0][0]), //false, true in 5.4 >> isset($array['foo']['bar'][0]), //true >> isset($array['foo']['bar']['baz']), //true >> isset($array['foo']['bar']['baz']['0']) //false, true as of 5.4 >> isset($string['foo']['bar']['baz']['0']) //false, true as of 5.4 >> ); >> > > you are missing a comma from the end of the > isset($array['foo']['bar']['baz']['0']) //false, true as of 5.4 > line > > > Yeah, I added that one at the last minute. That's what I get for a quick > copy/paste... > > > > isset($string['foo']['bar']['baz']['0']) //false, true as of 5.4 > gives me a fatal error on 5.3 ("PHP Fatal error: Cannot use string offse= t > as an array" as you can't "chain" string offsets before 5.4) > > > It gives me false in 5.3.6. Using it outside of isset() results in the > fatal error. > hm. tyrael@thor:~$ php -r '$string =3D "foo";isset($string["foo"]["bar"]["baz"]["0"]);'; PHP Fatal error: Cannot use string offset as an array in Command line code on line 1 tyrael@thor:~$ php -v PHP 5.3.8-1~dotdeb.2 with Suhosin-Patch (cli) (built: Aug 25 2011 13:30:46) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH I will check this against a vanilla version, as there is a chance that either dotdeb(less likely) or suhosin patched something. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001636499237ee184304b2777db8--