<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Software Developing &#187; inline object</title>
	<atom:link href="http://www.phpdeveloping.co.za/tag/inline-object/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpdeveloping.co.za</link>
	<description>for the love of PHP Development</description>
	<lastBuildDate>Tue, 29 Sep 2009 15:38:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Inline StdClass Object Creation</title>
		<link>http://www.phpdeveloping.co.za/class/inline-stdclass-object-creation.html</link>
		<comments>http://www.phpdeveloping.co.za/class/inline-stdclass-object-creation.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:14:09 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Class]]></category>
		<category><![CDATA[inline object]]></category>
		<category><![CDATA[stdclass object]]></category>

		<guid isPermaLink="false">http://www.phpdeveloping.co.za/?p=55</guid>
		<description><![CDATA[If you&#8217;re looking to create StdClass Objects inline, you&#8217;d probably normally do this:

$my_class = new StdClass;
$my_class-&#62;variable1 = &#34;test1&#34;;
$my_class-&#62;variable2 = &#34;test2&#34;;

You can put all that into one line using PHP&#8217;s casting operator

$my_class = &#40;object&#41; array&#40;&#34;variable1&#34; =&#62; &#34;test1&#34;, &#34;variable2&#34; =&#62; &#34;test2&#34;&#41;;

]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking to create StdClass Objects inline, you&#8217;d probably normally do this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$my_class</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> StdClass<span style="color: #339933;">;</span>
<span style="color: #000088;">$my_class</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">variable1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test1&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$my_class</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">variable2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test2&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can put all that into one line using PHP&#8217;s casting operator</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$my_class</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;variable1&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;test1&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;variable2&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;test2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpdeveloping.co.za/class/inline-stdclass-object-creation.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
