Statement blocks

A block is a series of statements that are executed sequentially, in the order they occur.

Usage

A block is simply a list of statements enclosed in braces { and }.

Class, function, getter, and setter definitions are all defined using blocks of statements. The if, for, switch, try, and while statements also involve blocks.

See also