Skip to content

Throw Expression (PHP 8)

PHP 8 allows throw to be used as an expression.

$value = $input ?? throw new Exception("Value required");