rfc:loop_or

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
rfc:loop_or [2014/09/19 21:39] – created leighrfc:loop_or [2014/09/20 16:48] leigh
Line 47: Line 47:
 Alternate syntax loops also gain this functionality with a ''or:'' clause. Alternate syntax loops also gain this functionality with a ''or:'' clause.
  
-This type of behaviour has been suggested before usually using the ''else'' keyword, originally the idea was to use the ''default'' keyword however this can break ''switch'' when using a semi-colon after the ''default'' keyword (thanks @ Paul Crovella) however using ''else'' especially has several drawbacks that make ''or'' more attractive:+This type of behaviour has been suggested before typically using the ''else'' keyword. There are several bug report feature requests for thisand several templating engines (i.e. Twig and Smarty) emulate this functionality for their users. 
 + 
 +The originally conceived alternative was to use the ''default'' keyword however this can break ''switch'' when using a semi-colon after the ''default'' keyword (thanks @ Paul Crovella). However using ''else'' especially has several drawbacks that make ''or'' more attractive:
  
  * Not backwards compatible by default due to dangling ''else''  * Not backwards compatible by default due to dangling ''else''
Line 141: Line 143:
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
-PHP.next (whether next is 7.0 or 5.7)+PHP 7
  
 ===== RFC Impact ===== ===== RFC Impact =====
Line 190: Line 192:
  
 ===== Changelog ===== ===== Changelog =====
 +2014-09-20 - Changed target version to PHP 7
 +
 +2014-09-20 - Added details that templating engines emulate this behaviour
 +
 2014-09-19 - v1.0 - RFC created 2014-09-19 - v1.0 - RFC created
  
rfc/loop_or.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1