Re: [RFC] Nullable and non-nullable cast operators

From: Date: Wed, 05 Nov 2025 08:38:44 +0000
Subject: Re: [RFC] Nullable and non-nullable cast operators
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-129084@lists.php.net to get a copy of this message
Hi Rowan,

> What you are proposing is a new syntax that changes step 5 to "else, throw a
> TypeError". That might be a useful feature in some cases, but it's nothing to do with the
> title of the RFC.

What we propose is to align these new operators to already existing
rules applied to function arguments. This is, indeed, stricter than
current cast operators. But I wouldn't say it has *nothing to do* with
the title of the RFC.
Maybe it's not perfectly accurate. If the naming is a problem and
should be changed, I'd be happy to hear suggestions and update
accordingly with a better name.

— Alexandre Daubois


Thread (18 messages)

« previous php.internals (#129084) next »