On Sun, Jul 1, 2018 at 11:27 AM Rasmus Schultz <ras...@mindplay.dk> wrote:
> I think we'll need the mixed type-hint in any case if we're to move
> ahead with generics?

I think Rasmus is alluding to this:

    interface Iterator<KeyType = mixed, ValueType = mixed> {
        // rest of impl
    }

So that we can make things generic but backwards compatible. Is that
what you are referring to, Rasmus?

-----

The name "mixed" has been in our manual for over a decade (possibly
closer to 2 decades) so I am fine with adding it to the language even
if I would prefer a different name for the semantic. I think the most
common name in other languages for this type is "any", which sometimes
excludes null, so "?any" is the same as "mixed".  I prefer "?any" but
would still vote in "mixed".

If we are going to add it I would prefer that we:
  - Add a deprecation notice in 7.3 informing users that they need to
change their name.
  - Create "mixed" or "?any" in 8.0.

This is the responsible thing to do if we are going to add it. There
is no functionality in 7.3 that will require it so there's no rush.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to