Thanks to visit codestin.com
Credit goes to github.com

Skip to content

throw can be used as an expression #27

@i582

Description

@i582

RFC: https://wiki.php.net/rfc/throw_expression

Example:

$callable = fn() => throw new Exception();
 
$value = $nullableValue ?? throw new InvalidArgumentException();

Metadata

Metadata

Assignees

No one assigned

    Labels

    PHP 8PHP 8 features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions