On Tue, Nov 22, 2016 at 5:52 PM, Dan Ackroyd <dan...@basereality.com> wrote: > Hi, > > This is the reintroduction of the Object Type RFC for discussion. > > There was previously strong feedback from people who would prefer that > the inheritance checks for methods that use object types should be > co/contravariant. This has been added to the RFC. > > https://wiki.php.net/rfc/object-typehint > > cheers > Dan > Ack > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
I strongly oppose this additional variance on the grounds that it assumes that all types that are not statically known to the engine are objects. This is a restrictive future compatibility concern. For instance enumerations (or enums) are one possible type I can see us adding that may not be objects. Additionally if we ever add named aliases for types and union types then those types are not necessarily objects either. Giving up these options for the sake of object variance is definitely not prudent in my opinion. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php