I have object properties in my code that look like this:
$obj -> $field;
Write the access like this:
This "enclose with braces" trick is useful in PHP whenever there is ambiguity due to variable variables.
Consider the initial code
$obj->$field -- does this mean "access the property whose name is given in
$field", or "access the element with key
0 of the property whose name is given in
$field"? The braces allow you to be explicit.