<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Mon, 20 May 2013 00:00:01 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sameer Borate's Blog: The benefits of colon syntax for control structures]]></title>
      <guid>http://www.phpdeveloper.org/news/11744</guid>
      <link>http://www.phpdeveloper.org/news/11744</link>
      <description><![CDATA[<p>
In <a href="http://www.codediesel.com/php/the-benefits-of-the-colon-syntax-for-control-structures/">this recent post</a> to his CodeDiesel.com blog, <i>Sameer</i> is promoting the use of colons in control structures over curly braces.
</p>
<blockquote>
PHP offers a alternative syntax for some of its control structures- if, while, for, foreach, and switch, where you change the opening brace to a colon (:) and the closing brace to endif;, endwhile;, endfor;, endforeach;, or endswitch;, respectively. [...] With the colon syntax you just have to match a '˜if' with a '˜endif' or a '˜for' with a '˜endfor'. When you are mixing HTML with PHP in web pages the code can become quite dense and confusing if it uses a lot of braces.
</blockquote>
<p>
An <a href="http://www.codediesel.com/php/the-benefits-of-the-colon-syntax-for-control-structures/">example</a> is included showing its use in "if" and "white" statements. With most editors and IDEs supporting brace matching and code folding, this is less of an issue, but it can help make for cleaner code.
</p>]]></description>
      <pubDate>Thu, 15 Jan 2009 08:48:33 -0600</pubDate>
    </item>
  </channel>
</rss>
