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]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to