Re: Object Type Casting Reloaded
| From: | Marcos Passos | Date: | Tue, 23 Apr 2019 00:44:29 +0000 |
| Subject: | Re: Object Type Casting Reloaded | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105339@lists.php.net to get a copy of this message | ||
Such a feature would be very helpful to ensure type safety! A big +1!
On Mon, Apr 22, 2019 at 19:51 Benjamin Morel <benjamin.morel@gmail.com>
wrote:
> Hi Azjezz, thanks for jumping in!
>
> > I have been using HackLang for quite a while now and i believe they have
> a better solution for this, and it would awesome to see it in PHP, the
>
as
> operator.
>
> If I understand correctly, as is an operator that performs type
> checks
> but never casts like () does.
> This looks like a serious candidate for an alternative syntax to the one I
> proposed!
>
> - Ben
>