<?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>Sat, 18 May 2013 14:50:48 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Joshua Thompson's Blog: Prototype-based programming in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/6676</guid>
      <link>http://www.phpdeveloper.org/news/6676</link>
      <description><![CDATA[<p>
Exploration in a language is always a good thing and, in <a href="http://personal.schmalls.com/2006/11/06/prototype-based-programming-in-php/">this new post</a> to his blog, <i>Joshua Thompson</i> approaches a method of programming familiar to Javascript users - Prototype-based programming.
</p>
<blockquote>
The basic idea is that functions can be added to classes dynamically. In Javascript functions can be added to a static class (using prototype) and it will be added to all instances of the class, or they can be added to a specific instance and only be added to that instance.
</blockquote>
<p>
The rest of <a href="http://personal.schmalls.com/2006/11/06/prototype-based-programming-in-php/">the post</a> is all about the code - a Prototype class that sets up the __get, __call, __set magic functions and a prototype() method and isCallable method (to check if a function exists). In his example, he creates three test classes that he adds functions to, including one that inherits from one of the other test classes (and not just the Prototype class). 
</p>
<p>
In the end, he uses it to call his custom "fun" methods, outputting various results based on the contents passed in.
</p>]]></description>
      <pubDate>Thu, 09 Nov 2006 11:13:47 -0600</pubDate>
    </item>
  </channel>
</rss>
