Reads an idkeyobject property $this:
$this->idKey;
Reads the property name of an object variable $this( examplein this case), therefore $this->example:
$idKey = 'example';
$this->$idKey;
Same as above ( $this->example), but with less uncertainty (similar to adding parentheses to control the order of operands and useful in some cases):
$idKey = 'example';
$this->{$idKey};
A case where this can add clarity or control order:
$this->{$idKey['key']};
$this->{$idKey}['key'];
source
share