Re: [RFC] [Vote] Type Guards for Classes
| From: | Benjamin Morel | Date: | Thu, 16 May 2024 21:23:46 +0000 |
| Subject: | Re: [RFC] [Vote] Type Guards for Classes | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123325@lists.php.net to get a copy of this message | ||
On Thu, 16 May 2024 at 22:33, Patrik Václavek <PaTrOnY@email.cz> wrote:
> Introduction
> *************
>
> This RFC proposes a new feature in PHP: type guards for classes (or
> interfaces). This feature aims to simplify and standardize the process of
> verifying that a variable is an instance of a specific class, enhancing
> code readability and reducing boilerplate code.
>
Hi, please see this discussion:
https://externals.io/message/105332
In particular this comment from Nikita:
https://externals.io/message/105332#105348
That being said, I would still love it if we could find a way to get this
feature, under this syntax or another, into PHP!
- Ben