Re: RFC Proposal - Types for Inline Variables
| From: | Rowan Tommins | Date: | Tue, 07 Feb 2023 16:21:49 +0000 |
| Subject: | Re: RFC Proposal - Types for Inline Variables | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119480@lists.php.net to get a copy of this message | ||
On 07/02/2023 14:07, Olle Härstedt wrote:
It should perhaps be mentioned that analyzers can use type annotations during their process, instead of the more clunky /** @var string */ or similar you have to use today for local variables.This sounds like you're reaching for Python's approach, where the language "supports" the type annotation syntax, but doesn't actually do anything with it. I explained in another thread why I think that is a poor compromise, because it's unclear whether you can actually trust the annotations. The current "clunky" syntax is clearly a comment as far as the language itself is concerned, so there is no expectation when reading it that it will have a meaning to plain PHP. Regards, -- Rowan Tommins [IMSoP]