Throw Expression (PHP 8)
PHP 8 allows throw to be used as an expression.
Example
Section titled “Example”$value = $input ?? throw new Exception("Value required");PHP 8 allows throw to be used as an expression.
$value = $input ?? throw new Exception("Value required");