<?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>Wed, 19 Jun 2013 06:28:45 -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>
    <item>
      <title><![CDATA[Mike's Blog: Time to say Good Bye]]></title>
      <guid>http://www.phpdeveloper.org/news/4318</guid>
      <link>http://www.phpdeveloper.org/news/4318</link>
      <description><![CDATA[According to <a href="http://blog.iworks.at/?/archives/30-Time-to-say-Good-Bye.html">this post</a> on <i>Mike</i>'s blog today, it's "time to say goodbye" to curly braces.
<p>
<quote>
<i>
Yeah, it may come suddenly, but it's time to say good bye to curly braces used as string indexing operator.
<p>
PHP-5.1 will issue an E_STRICT error, and PHP-6 will probably don't know this syntax any more.
<p>
I don't know why, but I've got some strange sentimental feelings, maybe because I've never used those other brackets for string indexing...
</i>
</quote>
<p>
The method he's <a href="http://blog.iworks.at/?/archives/30-Time-to-say-Good-Bye.html">talking about here</a> is the $string{0} format, and it's making way for a unified string/array operator. It won't break things badly, though - in PHP 5.1 it'll just toss out a non-fatal error to let you know. But watch out, by PHP6, this functionality will be gone...]]></description>
      <pubDate>Thu, 17 Nov 2005 05:38:33 -0600</pubDate>
    </item>
  </channel>
</rss>
