Dot Notation

bobthecow edited this page Mar 7, 2012 · 1 revision

Dot Notation

Dot notation is a shortcut syntax for quickly accessing methods or properties of variables.

Given the following context:

    'foo' => array(
        'bar' => array(
            'baz' => 'qux',

You can use dot notation to access the attributes of a variable:


Which will render as "qux".

This can be thought of as (approximately) equivalent to the following nested sections:


Note that it is only approximately equivalent, as the rules for variable resolution differ somewhat between the two examples.