Re: [DISCUSSION] Checking uninitialized class properties
| From: | Erick de Azevedo Lima | Date: | Sat, 18 May 2024 13:22:48 +0000 |
| Subject: | Re: [DISCUSSION] Checking uninitialized class properties | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123345@lists.php.net to get a copy of this message | ||
> I am already using a solution like the one
> proposed by Robert: it works but it leaves some doubts since each project
> can have a different name for NotSet while it seems a general concept of
the language
Hi everyone.
I just thought of some ways to standardize this:
1 - Create an RFC to create an "uninitialized" construct/function to make
this check;
2 - Ask Larry and Ilija to include an "is uninitialized" pattern into their
wonderful Pattern Matching RFC (https://wiki.php.net/rfc/pattern-matching);
3 - Create a PSR to create this "Uninitialized" class and constant standard
to PHP.
I would go for option 2.
Best regards,
Erick