Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Arm

An arm is a branch in a match() expression. There is the default arm, and the other arms. The arm includes the case, on the left, and the payload, on the right.

<?php

    // a match with 2 arm, including the default
    $a = match($b) {
        1 => 2,
        default => 3,
    };

?>

Documentation

See Also