On Thu, Mar 21, 2024, at 3:02 PM, Robert Landers wrote:

> I don't think you are getting what I am saying.
>
> $a as int|float
>
> would be an int, float, or thrown exception.
>
> $a as int|float|null
>
> would be an int, float, or null.
>
> Robert Landers
> Software Engineer
> Utrecht NL

Hi Rob.  I really do encourage you to read the RFC that Ilija linked to 
already.  What you're proposing is already mostly written (though for 
performance reasons may be rewritten soon), and the edge cases already largely 
resolved.

https://wiki.php.net/rfc/pattern-matching

--Larry Garfield

Reply via email to