<?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 19:44:06 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brandon Savage's Blog: Why Interfaces Rock]]></title>
      <guid>http://www.phpdeveloper.org/news/13285</guid>
      <link>http://www.phpdeveloper.org/news/13285</link>
      <description><![CDATA[<p>
According to the latest post on his blog <i>Brandon Savage</i> thinks <a href="http://www.brandonsavage.net/why-interfaces-rock/">interfaces rock</a>:
</p>
<blockquote>
When I first learned PHP 5's object oriented syntax and rules, I didn't see much of a point to the <a href="http://us2.php.net/manual/en/language.oop5.interfaces.php">interface</a> options. I felt that I could do more by defining <a href="http://us2.php.net/manual/en/language.oop5.abstract.php">abstract classes</a> and at least filling in some of the methods with some details. [...] As a developer, I've often wished there was a way to know that an object - any object - had implemented certain methods. With type hinting and the instanceof operator, it is now possible to determine whether or not an object has those methods, and interfaces make this even easier. 
</blockquote>
<p>
He includes an example or two of how type hinting can help you enforce and predict what sort of methods are defined in other classes. He also points out that this can be one of the major drawbacks of interfaces as well - because they are so strict, they have to be adhered to exactly.
</p>]]></description>
      <pubDate>Fri, 25 Sep 2009 09:11:32 -0500</pubDate>
    </item>
  </channel>
</rss>
