I am a little confused by some PHP syntax that I came across. Here is an example:
$k = $this->_tbl_key;
if( $this->$k)
{
$ret = $this->_db->updateObject( $this->_tbl, $this, $this->_tbl_key, $updateNulls );
}
else
{
$ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key );
}
My question basically means what does it mean $this->$k? I figured this could mean a member variable that goes by the name of what is in $this->_tbl_key, but how will it work? Is it possible to add member variables to a class at runtime?
source
share