<p>I'm a little confused by some PHP syntax I've come across.  Here is an example:</p>

<pre><code>$k = $this-&gt;_tbl_key;

if( $this-&gt;$k)
{
   $ret = $this-&gt;_db-&gt;updateObject( $this-&gt;_tbl, $this, $this-&gt;_tbl_key, $updateNulls );
}
else
{
    $ret = $this-&gt;_db-&gt;insertObject( $this-&gt;_tbl, $this, $this-&gt;_tbl_key );
}
</code></pre>

<p>My question is basically what does <code>$this-&gt;$k</code> mean?  I figured it might mean the member variable that goes by the name of whatever is in <code>$this-&gt;_tbl_key</code>, but how would that work?  Is it possible to add member variables to a class at run-time?</p>

It'll look up whatever the value of "k" is, and treat it as a variable name. These two samples are the same:
```
```
echo ($obj->myvar);

####

$k = "myvar";
echo ($obj->$k);
```
```