Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 343 Bytes

UnhandledMatchCondition.md

File metadata and controls

19 lines (13 loc) · 343 Bytes

UnhandledMatchCondition

Emitted when a match expression does not handle one or more options.

<?php

function matchOne(): string {
    $foo = rand(0, 1) ? "foo" : "bar";

    return match ($foo) {
        'foo' => 'foo',
    };
}

Why this is bad

The above code will fail 50% of the time with an UnhandledMatchError error.