Re: [RFC] Mixed type
| From: | Rowan Tommins | Date: | Fri, 24 Apr 2020 13:29:31 +0000 |
| Subject: | Re: [RFC] Mixed type | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109825@lists.php.net to get a copy of this message | ||
On Fri, 24 Apr 2020 at 13:18, Lynn <kjarli@gmail.com> wrote:
> I would love to see mixed being added as it lets me remove a lot of
> docblocks that are only added so I can indicate mixed. I disagree that it's
> patching holes, it's filling a gap that's currently missing something.
>
I realise it's partly a matter of style, but if I were benevolent dictator
of a legacy code base, I'd prefer to keep the docblocks, and mandate that
all uses of "mixed" should include a comment describing what the parameter
/ return type represents / is related to. Similarly, I wouldn't delete a
docblock for a return type of "array", because I'd want more specific
details (either using "type[]" syntax, "list<type>" syntax, or a comment
describing the "shape" of the array).
I'm not as strongly against adding "mixed" to the language as Bob, but I'm
not convinced I'd ever bother using it.
Regards,
--
Rowan Tommins
[IMSoP]