I just came across this piece of code, but I can't seem to understand what the body means:
public function __set($propName, $propValue)
{
$this->{$propName} = $propValue;
}
what does $this->{$propName}
do?
$this->{$propName}
accesses property named $propName. If $propName === 'name'
then $this->{$propName}
is the same as $this->name
.
More information here: http://php.net/manual/en/language.variables.variable.php