Re: [RFC] Mixed Typehint
| From: | Stanislav Malyshev | Date: | Tue, 19 Dec 2017 08:49:38 +0000 |
| Subject: | Re: [RFC] Mixed Typehint | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101377@lists.php.net to get a copy of this message | ||
Hi!
> Why document code? It contributes nothing to the behavior of the code,
> well, unless you parse it as annotations.
I am not sure I understand - are you arguing for supporting "mixed" in
*documentation*? Then it's already supported and there's no need for any
RFC. But if you're arguing for supporting it in the code, it's useless
and has nothing to do with documentation - which you'd have to write
anyway.
> The current one isn't any convention, it's just not possible to do
> something else. There's nothing that explicitly allows saying "I accept
> all types", rather than "The type I accept is unspecifed".
There could be of course logical constructions that are not supported by
the type system. "mixed" however has the accepted meaning - and that
meaning is exactly the same as not specifying the type. I do not see any
additional use of type that only means "unspecified type" - it looks
like its sole reason is so that somebody could say "I now have lots of
types in my code!" which does not seem to me a worthy goal. Types should
serve a purpose, this one serves none.
--
Stas Malyshev
smalyshev@gmail.com