Skip to content

Or Statements

Benedict Albrecht edited this page May 20, 2026 · 4 revisions

Or Statements

Or statements allow you to define alternative paths within an object definition.

Syntax

<| optionA <||> optionB <||> ... |>

Example

A function that can be private, public, or neither:

<:function:> <| private <||> public <||> |> function <<name>> ( ) { <---> } <:>

This matches any of:

  • private function myFunc ( ) { ... }
  • public function myFunc ( ) { ... }
  • function myFunc ( ) { ... } (empty option = optional)

Note: An empty option before the closing |> means the entire or-block is optional (zero occurrences accepted).

Clone this wiki locally