title: Force someone to make his sub classes implement an interfaces' methods
body: <p>I'm wondering how to force sub classes to implement a given interface method.</p>
  
  <p>Let's say I have the following classes :</p>
  
  <pre><code>interface Serializable
  {
      public function __toString();
  }
  
  abstract class Tag // Any HTML or XML tag or whatever like &lt;div&gt;, &lt;p&gt;, &lt;chucknorris&gt;, etc
  {
      protected $attributes = array();
  
      public function __get($memberName)
      {
          return $this-&gt;attributes[$member];
      }
  
      public function __set($memberName, $value)
      {
          $this-&gt;attributes[$memberName] = $value;
      }
  
      public function __construct() { }
  
      public function __destruct() { }
  }
  </code></pre>
  
  <p>I would like to force any sub class of "Tag" to implement the "Serializable" interface. For example, if i a "Paragraph" class, it would look this way :</p>
  
  <pre><code>class Paragraph extends Tag implements View
  {
      public function __toString()
      {
          print '&lt;p';
          foreach($this-&gt;attributes as $attribute =&gt; $value)
              print ' '.$attribute.'="'.$value.'"';
          print '&gt;';
  
          // Displaying children if any (not handled in this code sample).
  
          print '&lt;/p&gt;';
      }
  }
  </code></pre>
  
  <p>How can i force a developer to make his "Paragraph" class implement the methods from the interface "Serializable"?</p>
  
  <p>Thanks for taking the time to read.</p>