Hi Khaled On Mon, Jun 30, 2025 at 1:03 AM Khaled Alam <khaledalam....@gmail.com> wrote: > > I’d like to request RFC karma to create a new proposal titled "Fail-Fast > Assertion Operator (=>!)". > > $name =>! die("Missing name"); > This is equivalent to: > if (!$name) { > die("Missing name"); > }
As mentioned by the other responses, given that throw is an expression you can already achieve this through various operators: // Throw is $name is null $name ?? throw new Exception(); // Throw if $name is empty $name ?: throw new Exception(); // Throw if $name is falsy $name || throw new Exception(); $name or throw new Exception(); // Throw if $name is truthy $name && throw new Exception(); $name and throw new Exception(); It's not clear in what way your proposal is different. Hence, I'm pausing the granting of RFC karma until these details are clarified. Cheers