<?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 Quick Tip: Using the Ternary Operator</title>
	<atom:link href="http://dev-tips.com/featured/php-quick-tip-using-the-ternary-operator/feed" rel="self" type="application/rss+xml" />
	<link>http://dev-tips.com/featured/php-quick-tip-using-the-ternary-operator</link>
	<description>Become a Better Developer, One Tip at a Time.</description>
	<lastBuildDate>Sun, 07 Mar 2010 17:43:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: PHP Tip: Remove an Item From an Array By Value &#124; Dev Tips &#124; Become a Better Developer, One Tip at a Time.</title>
		<link>http://dev-tips.com/featured/php-quick-tip-using-the-ternary-operator#comment-702</link>
		<dc:creator>PHP Tip: Remove an Item From an Array By Value &#124; Dev Tips &#124; Become a Better Developer, One Tip at a Time.</dc:creator>
		<pubDate>Sun, 10 May 2009 00:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://dev-tips.com/?p=88#comment-702</guid>
		<description>[...] 10: We use a ternary operator to return the array with its keys intact or with new keys. An easy way to return only the keys of [...]</description>
		<content:encoded><![CDATA[<p>[...] 10: We use a ternary operator to return the array with its keys intact or with new keys. An easy way to return only the keys of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 網站製作學習誌 &#187; [Web] 連結分享</title>
		<link>http://dev-tips.com/featured/php-quick-tip-using-the-ternary-operator#comment-231</link>
		<dc:creator>網站製作學習誌 &#187; [Web] 連結分享</dc:creator>
		<pubDate>Wed, 11 Feb 2009 01:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://dev-tips.com/?p=88#comment-231</guid>
		<description>[...] PHP Quick Tip: Using the Ternary Operator [...]</description>
		<content:encoded><![CDATA[<p>[...] PHP Quick Tip: Using the Ternary Operator [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://dev-tips.com/featured/php-quick-tip-using-the-ternary-operator#comment-109</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Thu, 29 Jan 2009 02:02:45 +0000</pubDate>
		<guid isPermaLink="false">http://dev-tips.com/?p=88#comment-109</guid>
		<description>I could see how that could be very handy, some would probably complain about the readability, but I think its a nice little technique if it works for you :)

Much thanks for your comment and input Paul.</description>
		<content:encoded><![CDATA[<p>I could see how that could be very handy, some would probably complain about the readability, but I think its a nice little technique if it works for you <img src='http://dev-tips.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Much thanks for your comment and input Paul.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://dev-tips.com/featured/php-quick-tip-using-the-ternary-operator#comment-108</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 29 Jan 2009 01:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://dev-tips.com/?p=88#comment-108</guid>
		<description>My favorite trick here is using the ternary operator as a fake &quot;gated or&quot;. By that, I mean, the value returned is the second value only if the first is falsy.

$val = ($x = $a) ? $x : $b;

If A is truthy, then $val === $a.
If A is falsy, then $val === $b.

This is handy when getting the results of a function.

$val = ($x = myFunction()) ? $x : anotherFunction();</description>
		<content:encoded><![CDATA[<p>My favorite trick here is using the ternary operator as a fake &#8220;gated or&#8221;. By that, I mean, the value returned is the second value only if the first is falsy.</p>
<p>$val = ($x = $a) ? $x : $b;</p>
<p>If A is truthy, then $val === $a.<br />
If A is falsy, then $val === $b.</p>
<p>This is handy when getting the results of a function.</p>
<p>$val = ($x = myFunction()) ? $x : anotherFunction();</p>
]]></content:encoded>
	</item>
</channel>
</rss>
