title: How do you iterate through current class properties (not inherited from a parent or abstract class)?
body: <p>I know that PHP5 will let you iterate through a class's properties.  However, if the class extends another class, then it will include all of those properties declared in the parent class as well.  That's fine and all, no complaints.</p>
  
  <p>However, I always understood SELF as a pointer to the current class, while $this also points to the current object (including stuff inherited from a parent)</p>
  
  <p>Is there any way I can iterate ONLY through the current class's properties.  Reason why I'm asking this.... I'm using CI and iterating through $this includes tons of parent properties that I don't need.</p>
  
  <pre><code>&lt;?php
  
  class parent 
  {
     public $s_parent = "Parent sez hi!";
     public $i_lucky_number = 6;
  }
  
  class child extends parent
  {
     public $s_child = "Child sez hi!";
     public $s_foobar = "What What!!";
     public $i_lucky_number = 7;
  
     public iterate()
     {
        foreach ($this as $s_key =&gt; $m_val)
        {
            echo "$s_key =&gt; $m_val&lt;br /&gt;\n";
        }
     }
  
  }
  
  $o_child = new child();
  $o_child-&gt;iterate()
  </code></pre>
  
  <p>The output is</p>
  
  <pre><code>s_parent =&gt; Parent sez hi! 
  s_child =&gt; Child sez hi! 
  s_foobar =&gt; What What!!
  i_lucky_number =&gt; 7
  </code></pre>
  
  <p>I DON'T Want to see "s_parent => Parent sez hi!"</p>
  
  <p>I just want to iterate through the current class's properties.  Not those inherited elsewhere.</p>
  
  <p>Thanks in advance.</p>