Re: [RFC] Loop... or...

From: Date: Fri, 19 Sep 2014 22:08:48 +0000
Subject: Re: [RFC] Loop... or...
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-77350@lists.php.net to get a copy of this message
On 19/09/2014 22:56, Leigh wrote:
Hello list! This is an item that has been repeatedly requested in various forms, with no solid implementation to back it up, yet remaining quite desirable to the developer community at large. Loops with a default block, executed in the event that the loop is never entered. https://wiki.php.net/rfc/loop_or
Interesting! Not sure I've ever felt the need for it, but it seems like it could be quite handy to have in the toolbox, as it were. It's worth noting that both Smarty and Twig implement a similar mechanism in their respective foreach loop syntax. Smarty spells it {foreachelse} http://www.smarty.net/docs/en/language.function.foreach.tpl Twig spells it {% else %} http://twig.sensiolabs.org/doc/tags/for.html#the-else-clause -- Rowan Collins [IMSoP]

« previous php.internals (#77350) next »