Re: [RFC] Loop... or...
| From: | Leigh | Date: | Mon, 22 Sep 2014 09:15:20 +0000 |
| Subject: | Re: [RFC] Loop... or... | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77438@lists.php.net to get a copy of this message | ||
On 22 September 2014 08:17, Christian Stoller <stoller@leonex.de> 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 ;)