Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97136 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95138 invoked from network); 23 Nov 2016 01:25:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2016 01:25:10 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.180 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.161.180 mail-yw0-f180.google.com Received: from [209.85.161.180] ([209.85.161.180:35478] helo=mail-yw0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/60-26188-1FFE4385 for ; Tue, 22 Nov 2016 20:25:08 -0500 Received: by mail-yw0-f180.google.com with SMTP id i145so30026674ywg.2 for ; Tue, 22 Nov 2016 17:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LwN3fnmAMXr/QsEOZQezLuLDvihCZutrPRWgk8LoxEo=; b=I0vT4h3xefjhvNYW6BrxFo+qnIQHjVRgYFv1gH9p/qNX7XDdyFVMhMD2oLytdkDhjn Q0qKjwnW5E9Vfyukj7IBvAj1RPY6N+wB/63sLTIS97BlAcYvr3pEFz2JUYTYKR46vvgW N8HXocvvfu847vemzyPVnDkiSMVRnYmv1AqvGsjVLV0LBBFGqCYl5HpMkmS9ZqNb2Dxm mEAKltfmrYYBciiL5CeXPiMOdLENkJGdHbBJ4vsYXwjxUdCYLmUs7KQZwYzavWsUkFgW 8uK/SO7fYjvouE7MduoW6WNYKenf0YCGbamh1ycjH8dSip2E0UInnc/V+9tyYnH9O0e1 LgbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LwN3fnmAMXr/QsEOZQezLuLDvihCZutrPRWgk8LoxEo=; b=Zm855ZYJROEru5uOUnDrcZxoMJhwJZ5pU+mV2yONNopuxuaoWzBFIvjiDjP8p7WcCa +AO1DviRYkyP/Xb82NeX2c1yb12EtyZFBa5qSttm0bc/uHThR8xxnyLatjtSlO9cN5s4 zd8fQNoXmTJKdInuBJCokzKH6dMqGG+c7dWPkiw2LBpPdIoEa3mlJ2EclxL1cEFZwQdv txdZw7i+yBJrHMIOcp2iZFsaUtUm5suaJN+wJq7sAy6Y+LORTq6at6W6TxAmsjniYGEv JtBpdFeegX1vkdgSmaCB5+gZNFc3tWVmu/cyUe3IltGwmiLroVKQ0CNzecZg267G5ORc /84Q== X-Gm-Message-State: AKaTC02Z2zyI/+NPWfQqeLASsPgpIIcQmyk5+EqLBHgPz23b48KfEjp6Z15erqbPetec8yvuAGA2FMSSp7dSMw== X-Received: by 10.129.75.2 with SMTP id y2mr727695ywa.120.1479864303392; Tue, 22 Nov 2016 17:25:03 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.13.235.81 with HTTP; Tue, 22 Nov 2016 17:25:03 -0800 (PST) In-Reply-To: References: Date: Tue, 22 Nov 2016 18:25:03 -0700 X-Google-Sender-Auth: XQ2-yEQkXhLkUxkg7FidAE49NQA Message-ID: To: Dan Ackroyd Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint, now with added variance From: levim@php.net (Levi Morrison) On Tue, Nov 22, 2016 at 5:52 PM, Dan Ackroyd 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.