title: Getting an object back when I should get a string
body: <p>So I wrote a basic class which I have extended to create html element. Based on Zend - HOWEVER not exactly. <strong>No this is not a question about or in relation to zend</strong></p>
  
  <pre><code>class AisisCore_Form_Elements_Input extends AisisCore_Form_Element {
  
      protected $_html = '';
  
      public function init(){
  
          foreach($this-&gt;_options as $options){
              $this-&gt;_html .= '&lt;input type="text" ';
  
              if(isset($options['id'])){
                  $this-&gt;_html .= 'id="'.$options['id'].'" ';
              }
  
              if(isset($options['class'])){
                  $this-&gt;_html .= 'class="'.$options['class'].'" ';
              }
  
              if(isset($options['attributes'])){
                  foreach($options['attributes'] as $attrib){
                      $this-&gt;_html .= $attrib;
                  }
              }
  
              $this-&gt;_html .= $this-&gt;_disabled;
              $this-&gt;_html .= ' /&gt;';
  
              return  $this-&gt;_html;
          }
      }
  }
  </code></pre>
  
  <p>so this class extends my element class which consists of a constructor that takes in an array of options, a basic element is set up as such:</p>
  
  <pre><code>$array_attrib = array(
      'attributes' =&gt; array(
          'placeholder' =&gt; 'Test'
      )
  );
  
  $element = new AisisCore_Form_Elements_Input($array_attrib);
  echo $element;
  </code></pre>
  
  <p>So what's the problem?</p>
  
  <p>echoing the $element object gives me an error saying it cant convert the object to a string, thus when I var_dump it I get this back:</p>
  
  <pre><code>object(AisisCore_Form_Elements_Input)#21 (3) {
    ["_html":protected]=&gt;
    string(22) "&lt;input type="text"  /&gt;"
    ["_options":protected]=&gt;
    array(1) {
      ["attributes"]=&gt;
      array(1) {
        ["placeholder"]=&gt;
        string(4) "Test"
      }
    }
    ["_disabled":protected]=&gt;
    NULL
  }
  </code></pre>
  
  <p>Can some one explain what's going on? Last I checked I was echoing out a string not an object. How did I manage to create an object?</p>
  
  <p>If you need to see the AisisCore_Form_Element class I will post it how ever all this class is a base class you extend to create the element. the only thing it takes is an array of options.</p>