title: PHP Listing Dynamic Member Variables
body: <p>How would I list all the public variables in an instantiated Object given that we do not know the variable names in the first place?</p>
  
  <p>Scenario<br>
  A class may have a function declared like:</p>
  
  <pre><code>function addVar($name, $val) {
      $this-&gt;$name = $val;
  }
  </code></pre>
  
  <p>I want a list of $names that were ever added to the object instance dynamically.</p>