title: PHP Variable vs Array vs Object
body: <p>This is probably considered a really silly question, but I'm in the process of putting together a simple template system for a website and am trying to keep track of my variable usage and keep everything neat and tidy.</p>
  
  <p>Can you tell me if there is any advantage/disadvantage to the following methods:</p>
  
  <p><strong>simple var:</strong><br></p>
  
  <pre><code>$tpl_title = 'my title'
  $tpl_desc = 'my text'
  </code></pre>
  
  <p><strong>array:</strong><br></p>
  
  <pre><code>$tpl['title'] = 'my title'
  $tpl['desc'] = 'my text'
  </code></pre>
  
  <p><strong>Object:</strong><br></p>
  
  <pre><code>$tpl-&gt;title = 'my title'
  $tpl-&gt;desc = 'my text'
  </code></pre>
  
  <p>I like the object method the best as it looks clean when echo'd within html as opposed to arrays and afaik it can be used in an array-like way? However, what I want to know is whether using objects in this way is considered bad practice or introduces unneccesary overheads?</p>