Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56521 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67356 invoked from network); 23 Nov 2011 18:34:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 18:34:45 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:48030] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/03-47904-4CC3DCE4 for ; Wed, 23 Nov 2011 13:34:44 -0500 Received: by bkbzt4 with SMTP id zt4so1971739bkb.29 for ; Wed, 23 Nov 2011 10:34:40 -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:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=0891/ktx5cPMBbl0zkMaH/aFsPpDShktVyojvobzeBU=; b=m7z9o8QKYXnBVtc5e8tIpI2UF88QM13gR3yKOg9g7VbJN2Httiq1ONB54R2Z2IlHIt tTaPhdY53NPfHkw4cccajcwDsz0lv99TottgeMLMKqhdeYk1ej4KHjiydO+nqqMZypjM htq8jpwoLwuY/f8aQHIVbEQLIqxB0nYbmU/Bs= MIME-Version: 1.0 Received: by 10.204.41.66 with SMTP id n2mr25615443bke.77.1322073280204; Wed, 23 Nov 2011 10:34:40 -0800 (PST) Sender: ekneuss@gmail.com Received: by 10.205.82.2 with HTTP; Wed, 23 Nov 2011 10:34:40 -0800 (PST) In-Reply-To: References: <20111123015008.GA12933@panix.com> <20111123023108.GA172@panix.com> <4ECCB549.904@lsces.co.uk> <4ECCBC56.3050602@sugarcrm.com> <20111123141408.GA11940@panix.com> <20111123153100.GB13420@panix.com> Date: Wed, 23 Nov 2011 19:34:40 +0100 X-Google-Sender-Auth: N5PecuIvMpkhlm3XCEsU5ubFPNg Message-ID: To: Pierre Joye Cc: RQuadling@gmail.com, Daniel Convissor , Stas Malyshev , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] 5.4 regression: non-existent sub-sub keys now have values From: colder@php.net (Etienne Kneuss) Hi, What people seem to have trouble with here is not that $string[0][0] == $string[0], but rather that $string['index'] === $string[0]... But as many people said, it is just how type juggling want: string index? Get me an int => 0. I believe the change introduced in 5.4 makes sense, the previous way it worked made no sense and was simply an anomaly. It is clear from this thread that the confusion comes from strings as string offsets, something "totally" different, but changing that would be a much bigger BC break I guess. Best, On Wed, Nov 23, 2011 at 19:22, Pierre Joye wrote: > On Wed, Nov 23, 2011 at 6:58 PM, Richard Quadling wrote: > >> Just looking for any test relating to isset() to see what tests will now fail. >> >> Neither of the isset() tests ext/standard/tests/general_functions look >> at arrays with associative indices. >> >> The behaviour with regard to unavailable associative indices has no tests. >> >> But using loose typing as a fallback for non existent keys seems >> really really wrong. >> >> Especially if the key is a constant. On what planet should ... >> >> isset($arr['exists']['test_existance']) should become isset($arr['exists'][0]) >> >> That just seems really wrong and the work around is awful. > > That's exactly why I stoped to use this syntax a long time ago. And I > was in favor to deprecate it and actually remove it the next major > release (6 that is). But that's another discussion. > > Unless I'm mistaken it seems that we have a clear and vicious BC break > here, the kind of changes that are annoying to catch and does not > bring a lot of benefits to PHP (given the actual usage of this > syntax). I would go with a revert, add tests and never change this > behavior again. It is a confusing enough topic. > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch