<?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: JavaScript&#8217;s Object Literal Notation in PHP</title>
	<atom:link href="http://scriptnode.com/article/javascripts-object-literal-notation-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://scriptnode.com/article/javascripts-object-literal-notation-in-php/</link>
	<description>Tips and tricks for web developers.</description>
	<lastBuildDate>Tue, 17 Aug 2010 14:15:22 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Oscar Campbell</title>
		<link>http://scriptnode.com/article/javascripts-object-literal-notation-in-php/comment-page-1/#comment-332</link>
		<dc:creator>Oscar Campbell</dc:creator>
		<pubDate>Tue, 17 Aug 2010 14:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=42#comment-332</guid>
		<description>I hear you! Gotta love javascript &amp; json!

This is what i do in php:


$myObject = o(&quot;{ 
	    child : { 
	        key : &#039;value&#039; 
	    }, 
	    foo : &#039;$interpolateVarsAlso&#039; 
}&quot;); 


&quot;function o&quot; is a wrapper and calls json_decode(o,true).

(I always try to make php feel more like javascript. When I get around to set up my own server and v8cgi is up to par I won&#039;t touch php any more :-)</description>
		<content:encoded><![CDATA[<p>I hear you! Gotta love javascript &amp; json!</p>
<p>This is what i do in php:</p>
<p>$myObject = o(&#8221;{<br />
	    child : {<br />
	        key : &#8216;value&#8217;<br />
	    },<br />
	    foo : &#8216;$interpolateVarsAlso&#8217;<br />
}&#8221;); </p>
<p>&#8220;function o&#8221; is a wrapper and calls json_decode(o,true).</p>
<p>(I always try to make php feel more like javascript. When I get around to set up my own server and v8cgi is up to par I won&#8217;t touch php any more :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Goodman</title>
		<link>http://scriptnode.com/article/javascripts-object-literal-notation-in-php/comment-page-1/#comment-225</link>
		<dc:creator>Peter Goodman</dc:creator>
		<pubDate>Wed, 22 Oct 2008 21:03:04 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=42#comment-225</guid>
		<description>Slight update: http://codepad.org/NWdIX9NE, extending arrayobject would be preferable to allow __get and __set instead of duplicating the data as I have.</description>
		<content:encoded><![CDATA[<p>Slight update: <a href="http://codepad.org/NWdIX9NE" rel="nofollow">http://codepad.org/NWdIX9NE</a>, extending arrayobject would be preferable to allow __get and __set instead of duplicating the data as I have.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Goodman</title>
		<link>http://scriptnode.com/article/javascripts-object-literal-notation-in-php/comment-page-1/#comment-224</link>
		<dc:creator>Peter Goodman</dc:creator>
		<pubDate>Wed, 22 Oct 2008 20:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=42#comment-224</guid>
		<description>Strict standards are worth sticking to, especially when considering forward compatibility. Here is another (more) concise way of getting your desired effect that uses the ArrayObject class from the standard php library: http://codepad.org/BxvCjXD2. It gives you the same that you have but also a lot more; you can interact with the object as if it were an array (ArrayAccess, Countable), and do other similar operations on it.</description>
		<content:encoded><![CDATA[<p>Strict standards are worth sticking to, especially when considering forward compatibility. Here is another (more) concise way of getting your desired effect that uses the ArrayObject class from the standard php library: <a href="http://codepad.org/BxvCjXD2" rel="nofollow">http://codepad.org/BxvCjXD2</a>. It gives you the same that you have but also a lot more; you can interact with the object as if it were an array (ArrayAccess, Countable), and do other similar operations on it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://scriptnode.com/article/javascripts-object-literal-notation-in-php/comment-page-1/#comment-84</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Fri, 25 Jul 2008 19:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://scriptnode.com/?p=42#comment-84</guid>
		<description>Hehe yeah I spent about 5 minutes looking at a bunch of lines of php code for my fuzzer and I couldn&#039;t understand why it didn&#039;t work

for($i=0;$i&lt;len;i++) {
}

DOH!

Damn for loops I code too many in javascript it&#039;s affecting my php brain :)</description>
		<content:encoded><![CDATA[<p>Hehe yeah I spent about 5 minutes looking at a bunch of lines of php code for my fuzzer and I couldn&#8217;t understand why it didn&#8217;t work</p>
<p>for($i=0;$i&lt;len;i++) {<br />
}</p>
<p>DOH!</p>
<p>Damn for loops I code too many in javascript it&#8217;s affecting my php brain :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
