<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: php: IF versus SWITCH</title>
	<atom:link href="http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/</link>
	<description></description>
	<lastBuildDate>Wed, 15 Jun 2011 05:03:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Marcus Carab</title>
		<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/comment-page-1/#comment-3204</link>
		<dc:creator>Marcus Carab</dc:creator>
		<pubDate>Fri, 08 Jan 2010 18:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/#comment-3204</guid>
		<description>To take this one step further, it&#039;s worth pointing out that both Switch &amp; If should be avoided if a conditional statement isn&#039;t actually necessary at all.  
 
In this example, let&#039;s say there was a custom message for *all twelve* months. The fastest and cleanest method would be to build an array of messages: 
 
$messages = array(&quot;message 1&quot;, &quot;message 2&quot;, &quot;message 3&quot;  ...  etc. ... ); 
 
And then to simply access the appropriate message using the month: 
 
echo $messages[$currentmonth]; </description>
		<content:encoded><![CDATA[<p>To take this one step further, it&#039;s worth pointing out that both Switch &amp; If should be avoided if a conditional statement isn&#039;t actually necessary at all.  </p>
<p>In this example, let&#039;s say there was a custom message for *all twelve* months. The fastest and cleanest method would be to build an array of messages: </p>
<p>$messages = array(&quot;message 1&quot;, &quot;message 2&quot;, &quot;message 3&quot;  &#8230;  etc. &#8230; ); </p>
<p>And then to simply access the appropriate message using the month: </p>
<p>echo $messages[$currentmonth];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: taranfx</title>
		<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/comment-page-1/#comment-1901</link>
		<dc:creator>taranfx</dc:creator>
		<pubDate>Tue, 22 Sep 2009 16:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/#comment-1901</guid>
		<description>I recently experimented the performance, and switch is certainly faster.  
What I did was auto-generated code for switch case vs. if-else for 500+ numbers and corresponding values. Switch case was approx. 20% faster at all times.  </description>
		<content:encoded><![CDATA[<p>I recently experimented the performance, and switch is certainly faster.<br />
What I did was auto-generated code for switch case vs. if-else for 500+ numbers and corresponding values. Switch case was approx. 20% faster at all times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DynamiXLabs</title>
		<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/comment-page-1/#comment-57</link>
		<dc:creator>DynamiXLabs</dc:creator>
		<pubDate>Sat, 02 Feb 2008 15:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/#comment-57</guid>
		<description>Well said explanation Deanzod, and thank you for your kind words!</description>
		<content:encoded><![CDATA[<p>Well said explanation Deanzod, and thank you for your kind words!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deanzod Website Design</title>
		<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/comment-page-1/#comment-56</link>
		<dc:creator>Deanzod Website Design</dc:creator>
		<pubDate>Fri, 01 Feb 2008 10:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/#comment-56</guid>
		<description>Dave, Switch should be slightly faster than if, when there are several cases, but if should be quicker for the first example. This is debatable though. Hard to test!
Great little tutorial though.Probably the simplest explanation of the switch function I&#039;ve seen on the net.</description>
		<content:encoded><![CDATA[<p>Dave, Switch should be slightly faster than if, when there are several cases, but if should be quicker for the first example. This is debatable though. Hard to test!<br />
Great little tutorial though.Probably the simplest explanation of the switch function I&#8217;ve seen on the net.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/comment-page-1/#comment-41</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 29 Jan 2008 18:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/#comment-41</guid>
		<description>Pretty good comparison/tutorial on using switch over if/else. What I would really like to know is if there is any sort of speed increase/decrease.</description>
		<content:encoded><![CDATA[<p>Pretty good comparison/tutorial on using switch over if/else. What I would really like to know is if there is any sort of speed increase/decrease.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

