<?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, 25 May 2013 12:28:17 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Eric Hogue's Blog: Late Static Binding]]></title>
      <guid>http://www.phpdeveloper.org/news/16235</guid>
      <link>http://www.phpdeveloper.org/news/16235</link>
      <description><![CDATA[<p>
<i>Eric Hogue</i> has a <a href="http://erichogue.ca/2011/04/14/late-static-binding/">recent post to his blog</a> looking at one of the more tricky aspects of the latest versions of PHP (the 5.3.x series) - late static binding. In a nutshell, late static binding (LSB) lets static classes and methods work more correctly than before. <i>Eric</i> gets into a bit more detail than that:
</p>
<blockquote>
It came out almost 2 years ago, but it to me that many programmers around me have no idea about it. Myself, I have learned about it around 6 months ago. The PHP documentation defines late static binding as a way to "reference the called class in a context of static inheritance." This definition didn't really help me the first time I read it. Fortunately, there are more explanations in the documentation, and there are good examples. If you haven't, you should read it.
</blockquote>
<p>
To clarify, he includes a code snippet showing the use of the "static" keyword to correctly reference a static method. He also includes in interesting bit about when's a good time to use it.
</p>]]></description>
      <pubDate>Fri, 22 Apr 2011 09:14:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage's Blog: A Lesson In Static Methods And Late Static Binding]]></title>
      <guid>http://www.phpdeveloper.org/news/14334</guid>
      <link>http://www.phpdeveloper.org/news/14334</link>
      <description><![CDATA[<p>
<i>Brandon Savage</i> in his frustrations with the Zend Framework and the "self" keyword in PHP has written up a new post showing how <a href="http://www.brandonsavage.net/a-lesson-in-static-methods-and-late-static-binding/">you can use late static binding</a> to work around it.
</p>
<blockquote>
he problem is, when extended, My_Auth::getInstance() still returns an instance of Zend_Auth. The solution was to duplicate the static method in my My_Auth class, which worked properly. What did I get as a return value? Zend_Auth [...] Why didn't I get an instance of My_Auth instead of Zend_Auth? Well, that's because PHP determines the meaning of the self keyword at compile time, meaning that when you call a function that makes use of it later, you'll get whatever it's been defined to mean when it was compiled.
</blockquote>
<p>
To remedy the situation he uses <a href="http://php.net/manual/en/language.oop5.late-static-bindings.php">late static binding</a> (in PHP 5.3+) by using the "static" keyword like you would use "self" to refer correctly to the current class, not the class it sees at runtime.
</p>]]></description>
      <pubDate>Mon, 12 Apr 2010 11:10:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jordi Boggiano's Blog: Multiton base class]]></title>
      <guid>http://www.phpdeveloper.org/news/11641</guid>
      <link>http://www.phpdeveloper.org/news/11641</link>
      <description><![CDATA[<p>
In <a href="http://seld.be/notes/multiton-base-class">this recent post</a> <i>Jordi Boggiano</i> looks at a different sort of design pattern - a sort of extension of the Singleton pattern: Multition.
</p>
<blockquote>
While I like the <a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singleton</a> pattern every now and then, I prefer the flexibility that the <a href="http://en.wikipedia.org/wiki/Multiton">Multiton</a> potentially offers, and well it's just an extended version of the Singleton, so it's "compatible" with the Singleton model. Anyway, to the point, PHP5.3 is coming, and with Late Static Binding you can do a base Multiton (or Singleton if you insist), which wasn't possible before. Now I like this very much because you can simply extend it rather than rewriting those (few, I know, but still) lines each time. 
</blockquote>
<p>
Included in <a href="http://seld.be/notes/multiton-base-class">the post</a> is an example of the design pattern showing how to create its structure in the class and use it to grab the same or unique instances (defined with an ID).
</p>]]></description>
      <pubDate>Tue, 30 Dec 2008 11:17:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[IBM developerWorks: What's new in PHP V5.3, Part 1: Changes to the object interface]]></title>
      <guid>http://www.phpdeveloper.org/news/11396</guid>
      <link>http://www.phpdeveloper.org/news/11396</link>
      <description><![CDATA[<p>
<i>John Mertic</i> has put together a <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new1/index.html">what's new</a> list in the upcoming PHP 5.3 release:
</p>
<blockquote>
PHP V5.3 is set to be released by the end of 2008, and many of the new features in this release have been in the planning stages for a few years. Originally touted as "PHP V6 without native Unicode support," PHP V5.3 has been developed into a feature-rich upgrade to the PHP V5 line. [...] In this "What's new in PHP V5.3" series, we'll look at these new V5.3 features, and see how they are used and how they can be used in your Web application.
</blockquote>
<p>In this first part of the series he talks about:</p>
<ul>
<li>Improved static method and member handling
<li>The _callStatic() magic method
<li>Dynamic static calls
<li>Late static binding
<li>Standard PHP Library
<li>Circular garbage collection
</ul>]]></description>
      <pubDate>Wed, 12 Nov 2008 11:13:30 -0600</pubDate>
    </item>
  </channel>
</rss>
