<?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 Variable Names: Curly Brace Madness</title>
	<atom:link href="http://cowburn.info/2008/01/12/php-vars-curly-braces/feed/" rel="self" type="application/rss+xml" />
	<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/</link>
	<description>Online storage depot for Peter Cowburn</description>
	<lastBuildDate>Thu, 03 May 2012 06:33:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Peter</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-71925</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 16 Feb 2012 13:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-71925</guid>
		<description>Bitcoin FAQ, &lt;strong&gt;yes&lt;/strong&gt; that will work as expected. :)</description>
		<content:encoded><![CDATA[<p>Bitcoin FAQ, <strong>yes</strong> that will work as expected. <img src='http://cowburn.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bitcoin FAQ</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-71912</link>
		<dc:creator>Bitcoin FAQ</dc:creator>
		<pubDate>Thu, 16 Feb 2012 03:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-71912</guid>
		<description>Bozo said: &lt;code&gt;$r-&gt;{&#039;1st_column&#039;}&lt;/code&gt;

Does object &#039;members&#039; include methods? eg. Is this valid syntax:

&lt;code&gt;$this-&gt;{$bool ? &#039;a&#039; : &#039;b&#039;}($args);&lt;/code&gt;

I am hoping it is equivalent to:

&lt;code&gt;if ($bool) $this-&gt;a($args) else $this-&gt;b($args);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Bozo said: <code>$r-&gt;{'1st_column'}</code></p>
<p>Does object &#8216;members&#8217; include methods? eg. Is this valid syntax:</p>
<p><code>$this-&gt;{$bool ? 'a' : 'b'}($args);</code></p>
<p>I am hoping it is equivalent to:</p>
<p><code>if ($bool) $this-&gt;a($args) else $this-&gt;b($args);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bozo</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-70257</link>
		<dc:creator>Bozo</dc:creator>
		<pubDate>Mon, 09 Jan 2012 18:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-70257</guid>
		<description>This also works with object members, where I had to use this recently to deal with a database wrapper:
&lt;code&gt;$r-&gt;1st_column&lt;/code&gt;
isn&#039;t valid, but
&lt;code&gt;$r-&gt;{&#039;1st_column&#039;}&lt;/code&gt;
works as expected.</description>
		<content:encoded><![CDATA[<p>This also works with object members, where I had to use this recently to deal with a database wrapper:<br />
<code>$r-&gt;1st_column</code><br />
isn&#8217;t valid, but<br />
<code>$r-&gt;{'1st_column'}</code><br />
works as expected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP Variables Names with a Dollar Sign &#124; 2bsharp</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-65206</link>
		<dc:creator>PHP Variables Names with a Dollar Sign &#124; 2bsharp</dc:creator>
		<pubDate>Tue, 28 Jun 2011 14:25:25 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-65206</guid>
		<description>[...] Cowburn.info [...]</description>
		<content:encoded><![CDATA[<p>[...] Cowburn.info [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua D. Burns</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-60437</link>
		<dc:creator>Joshua D. Burns</dc:creator>
		<pubDate>Fri, 10 Sep 2010 16:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-60437</guid>
		<description>what about:

&lt;pre&gt;&lt;code lang=&quot;php&quot;&gt;$foo = &#039;hi&#039;;
$bar = &#039;ho&#039;;
${$foo . $bar} = &#039;Yes!&#039;; // Same as $hiho&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>what about:</p>
<div class="codecolorer-container text twitlight moo-highlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;code lang=&quot;php&quot;&gt;$foo = 'hi';<br />
$bar = 'ho';<br />
${$foo . $bar} = 'Yes!'; // Same as $hiho&lt;/code&gt;</div></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suhail</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-59999</link>
		<dc:creator>Suhail</dc:creator>
		<pubDate>Wed, 07 Jul 2010 16:50:54 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-59999</guid>
		<description>Thanks

&lt;code&gt;${&#039;s&#039;.&#039;t&#039;.&#039;r&#039;} = &#039;Hello Peter&#039;;&lt;/code&gt;

Helped a lot.....
after hours of solution searching ...
&amp; solving problem</description>
		<content:encoded><![CDATA[<p>Thanks</p>
<p><code>${'s'.'t'.'r'} = 'Hello Peter';</code></p>
<p>Helped a lot&#8230;..<br />
after hours of solution searching &#8230;<br />
&#038; solving problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikola</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-56132</link>
		<dc:creator>Nikola</dc:creator>
		<pubDate>Sat, 22 Aug 2009 08:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-56132</guid>
		<description>@Peter - Try NetBeans, it is amazing.

I was trying to clean up some strings tonight and discovered that I can use curly braces within double quotes to concatenate a var with the text immediately following it.  It looks much much cleaner than using periods and double quotes.  For example, if working a dynamic CSS rule:

background-position: $x_offset&quot;.px.&quot; $y_offset&quot;.px.&quot;

vs.

background-position: {$x_offset}px {$y_offset}px.

...a lot more readable.</description>
		<content:encoded><![CDATA[<p>@Peter &#8211; Try NetBeans, it is amazing.</p>
<p>I was trying to clean up some strings tonight and discovered that I can use curly braces within double quotes to concatenate a var with the text immediately following it.  It looks much much cleaner than using periods and double quotes.  For example, if working a dynamic CSS rule:</p>
<p>background-position: $x_offset&#8221;.px.&#8221; $y_offset&#8221;.px.&#8221;</p>
<p>vs.</p>
<p>background-position: {$x_offset}px {$y_offset}px.</p>
<p>&#8230;a lot more readable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Accessibility and Dynamic Variable names &#171; Mr Chimp Learns to Write</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-56071</link>
		<dc:creator>Accessibility and Dynamic Variable names &#171; Mr Chimp Learns to Write</dc:creator>
		<pubDate>Wed, 19 Aug 2009 14:42:56 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-56071</guid>
		<description>[...] leaves anyone that looks at it completely bewildered. Who knows, maybe even something sensible. This guy seems to be getting quite excited about [...]</description>
		<content:encoded><![CDATA[<p>[...] leaves anyone that looks at it completely bewildered. Who knows, maybe even something sensible. This guy seems to be getting quite excited about [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atus</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-25759</link>
		<dc:creator>Atus</dc:creator>
		<pubDate>Wed, 03 Sep 2008 11:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-25759</guid>
		<description>Well,

I have a code, what worked in PHP 4.x but didn!t in PHP5.
The code uses the function you mentioned above.

with PHP5 the
print_r(${(&#039;_GET&#039;)});
line prints the global? $_GET array, while 
print_r(${(&#039;_G&#039;.&#039;ET&#039;)});
gives an &quot;Undefined variable: $_GET&quot; php error.

:(</description>
		<content:encoded><![CDATA[<p>Well,</p>
<p>I have a code, what worked in PHP 4.x but didn!t in PHP5.<br />
The code uses the function you mentioned above.</p>
<p>with PHP5 the<br />
print_r(${(&#8216;_GET&#8217;)});<br />
line prints the global? $_GET array, while<br />
print_r(${(&#8216;_G&#8217;.'ET&#8217;)});<br />
gives an &#8220;Undefined variable: $_GET&#8221; php error.</p>
<p> <img src='http://cowburn.info/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://cowburn.info/2008/01/12/php-vars-curly-braces/#comment-18129</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Sun, 13 Jan 2008 17:19:26 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/php/php-vars-curly-braces/#comment-18129</guid>
		<description>I have tried to use a whole slew of IDEs in the past and there&#039;s really nothing exceptionally wrong with them. I rather prefer almost just a &#039;window&#039; with the code in (pretty highlighted) and nothing much else.  

I remember trying Aptana, Zend, Eclipse, Komodo, PhpED, PHP Designer, PHP Edit--those are the ones I can name off the top of my head--but it was nearly always simply the &#039;bulk&#039; of such applications which put me off.   I&#039;m a Zen-like person and they all just made too much noise for my liking!</description>
		<content:encoded><![CDATA[<p>I have tried to use a whole slew of IDEs in the past and there&#8217;s really nothing exceptionally wrong with them. I rather prefer almost just a &#8216;window&#8217; with the code in (pretty highlighted) and nothing much else.  </p>
<p>I remember trying Aptana, Zend, Eclipse, Komodo, PhpED, PHP Designer, PHP Edit&#8211;those are the ones I can name off the top of my head&#8211;but it was nearly always simply the &#8216;bulk&#8217; of such applications which put me off.   I&#8217;m a Zen-like person and they all just made too much noise for my liking!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

