get a list of all variables defined outside a class by user
<p>i have something like this:</p>

<pre><code>class foo
{
   //code
}

$var = new foo();
$var-&gt;newVariable = 1; // create foo-&gt;newVariable
$var-&gt;otherVariable = "hello, im a variable";  //create foo-&gt;otherVariable
</code></pre>

<p>i can get in class foo a list of all variables defined outside by user (newVariable, otherVariable,etc)? Like this:</p>

<pre><code>class foo
{
   public function getUserDefined()
   {
      // code

   }
}

$var = new foo();
$var-&gt;newVariable = 1; // create foo-&gt;newVariable
$var-&gt;otherVariable = "hello, im a variable";  //create foo-&gt;otherVariable
var_dump($var-&gt;getUserDefined()); // returns array ("newVariable","otherVariable");
</code></pre>

<p>Thanks!.</p>
