Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4054 invoked from network); 22 Sep 2014 09:15:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2014 09:15:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:51521] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/C0-33885-AA8EF145 for ; Mon, 22 Sep 2014 05:15:23 -0400 Received: by mail-wi0-f181.google.com with SMTP id z2so2534974wiv.14 for ; Mon, 22 Sep 2014 02:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=e5K5FysDnyphyDTZ3zDoIwtdJG4lDUqKfa+uSKkgIMg=; b=Ysof3jRlw6X1tdTUUGVriUvVxb0oSZV22f/ZVblyRaSehTo/ez1q0YuJ4TiXFn3ZiK eecmoKOn/XQ0gmWT/uL7wQehapZSIaQ2ev72eTSRN/saH6F2+Rltg/aISP6CmwLwdqF5 kwdAyUe42hRVMQJYvznLXnpKWtXiBOlVnhuFRd3vpvYovVBFmOjpHQNPxut7M38GF4YA Zrab6tBkJm3kyvZglrVGVW0x+LNaWqbyHyoLokdNoN5nHuqKD2BgQIKd9nBLamWZSdNP IlPS5bYuPBiRh8orGLFNP7zTvNfjmzcNxuGubnMXYV706Gxn3Rtiqzt10wPz+zUn4gAB jmTQ== MIME-Version: 1.0 X-Received: by 10.180.11.65 with SMTP id o1mr14158399wib.58.1411377320120; Mon, 22 Sep 2014 02:15:20 -0700 (PDT) Received: by 10.217.55.195 with HTTP; Mon, 22 Sep 2014 02:15:20 -0700 (PDT) In-Reply-To: <4ED7146272E04A47B986ED49E771E347BBF1BAF6F4@Ikarus.ameusgmbh.intern> References: <4ED7146272E04A47B986ED49E771E347BBF1BAF6F4@Ikarus.ameusgmbh.intern> Date: Mon, 22 Sep 2014 10:15:20 +0100 Message-ID: To: Christian Stoller Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Loop... or... From: leight@gmail.com (Leigh) On 22 September 2014 08:17, Christian Stoller wrote: > > I like this proposal as I am using this feature in Twig very often. > But I would really prefer using "else" instead of "or", because it > is already common in the mentioned projects. > Maybe you could reconsider if it is really not possible to use "else". It's _really_ not possible to use "else" without a huge BC break in one form or another, something I'm trying to avoid at all costs. > What about making the brackets for the loop block obligatory for > using this feature? Unfortunately that wouldn't help, we'd have to enforce braces on everything (if/else/elseif/while/for/etc) to make it possible to hang an "else" on the bottom of a loop, again a pretty big BC break. I have actually discussed "braces everywhere" with several internals devs, and the response has been pretty much unanimous: We'd like it, but it will never pass the vote. It would be trivial to provide a migration script though. Feel free to test the water with this idea ;)