>
> > I'd like to propose and discuss Mixed Typehint RFC for PHP 7.3:
> > https://wiki.php.net/rfc/mixed-typehint
> >
> > The purpose of this RFC is to introduce "mixed" typehint on language
> level
> > to be used
> > as a valid typehint. PHP currently forces users to not use any type in
> case
> > the
> > type is mixed/unclear. This makes code inconsistent and less explicit.
> With
>
> I'm not sure what's the point of it. "mixed" means "any type". Not
> writing a type means "any type". So why waste space and add something
> that contributes nothing when everybody is already using the current
> convention and the new one does not add anything at all?


Why document code? It contributes nothing to the behavior of the code,
well, unless you parse it as annotations.

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".

That said, I'm not sure myself. I guess a more complex type which can't be
expressed currently (like a union type) might also use "mixed" then.

Regards, Niklas


> > mixed,
> > it should be easy to eliminate this inconsistency
>
> There's no "inconsistency" here.
>
> > and achieve fully type hinted code.
>
> This is not an "achievement" - adding prefixes for the sake of all
> variables having prefixes that mean nothing is not an "achievement". I
> do not see any point in it.
> --
> Stas Malyshev
> smalys...@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to