<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 17:54:36 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Stoyan Stefanov's Blog: JavaScript-style object literals in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16101</guid>
      <link>http://www.phpdeveloper.org/news/16101</link>
      <description><![CDATA[<p>
<i>Stoyan Stefanov</i> has a <a href="http://www.phpied.com/javascript-style-object-literals-in-php/">new post to his blog</a> looking at bringing something to PHP that Javascript developers have always had - object literals. These literals allow you to assign object properties at definition time instead of the usual PHP method of adding them either in the class definition or after the object exists.
</p>
<p>
<i>Stoyan</i> starts with an example of the object literals on Javascript and shows how it's (sort of) possible to replicate that wit type casting an array to an object in PHP. The tricky part comes in when you try to recreate the method handling JS gives in objects. Closures in PHP 5.3 comes close, but there's a few things he points out that just won't work the same way.
</p>
<p>
You can simulate some of this with __call method handling in a base "JSObject" class. For more details on his work bringing Javascript over to the world of PHP, check out <a href="http://www.slideshare.net/stoyan/javascript-for-php-developers-7245314">his presentation</a> from this year's <a href="http://confoo.ca">ConFoo</a> conference.
</p>]]></description>
      <pubDate>Fri, 25 Mar 2011 09:02:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[WebReference.com: The Building Blocks: Data Types, Literals, Variables, and Constants - Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/7139</guid>
      <link>http://www.phpdeveloper.org/news/7139</link>
      <description><![CDATA[<p>
WebReference.com has posted <a href="http://www.webreference.com/programming/php/by_example2/index.html">part two in a series</a> looking at the "building blocks" that make up PHP and its use. This time, it's a look at the containers for your data - the data types, literals, variables, and constants.
</p>
<p>
They go through each, explaining what they are, how they're used and when you'd want to use them in your code. They explain the data types and how those fit with each "container" and some basic things like valid names and how to assign things correctly.
</p>
<p>
They even get <a href="http://www.webreference.com/programming/php/by_example2/index.html">get into</a> working with variables from GET and POST requests as well as working with the scope of variables and getting the metadata about them (is it an integer? is it empty?)
</p>]]></description>
      <pubDate>Mon, 22 Jan 2007 09:52:00 -0600</pubDate>
    </item>
  </channel>
</rss>
