Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101366 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78935 invoked from network); 18 Dec 2017 20:48:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2017 20:48:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:35854] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/A8-21958-989283A5 for ; Mon, 18 Dec 2017 15:48:11 -0500 Received: by mail-wm0-f53.google.com with SMTP id b76so285997wmg.1 for ; Mon, 18 Dec 2017 12:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nSc/2ssS0VNOYE9C6g4V8hp748KmFCoOSczM469kMfM=; b=CRYlXt3ZE5p0PkG9kNuXZv4G7XYhEmRg58yfar0hY3rDhj34u91mNUXjmtPoYvyUWs pukU5MlSqHbKfuweG+besEp8H8u8BTGF1mb8EDRDbX818ISVIi5RbcxypyTFn4rI/Y9m pYExTZTZz+mjD+DKX4bt0LTba/sr2YpPpOeJUlyNu+jLNatFnwnYMuR8xCgTzTdaR2SB UHlIfvMoNrx1RiqzqOfHNM/ZSj8v8guD9kHyerJr/GEpkKxRwZ+nPwqZ5oox3ilhRYTA F5r1qXzM296CMSdn62FmmBe2dMZiSziQ6GmrfdXRZ19LUUsolVzf8qTqVqTCKL/Y0zp1 MCNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nSc/2ssS0VNOYE9C6g4V8hp748KmFCoOSczM469kMfM=; b=uKVmkHxP/H6AvHm+RLEC/x8hDgb8aU5epIH4EsfZc9oB9qVDPyz6S2yH6qnmTt2SMX nWJxBP7MmVIX6bUM2re2x7/s5oH3G/h0R6D4pRq9H5N4ZgaaI+mofJMP+F3AJ/lsOtQI 3fbbijgYNkjyqpEYN3giCqUv5+AeYi/4bf0uOwVVPOsy04BJ96ZnE1scR1Q1p+qfru6X PmmdryJ00WBAtku2cnKRAd4idaBDPyHrUCugweVBcLcMzYhdzBTX22tPD3mnurENhdYI jyN15BeuFZsQtN3qdS6c3BEGbk1ESBrYHdeULSlTLLCe6Lj29pXAE0VXeZVZ9f+1s/Ms JWPA== X-Gm-Message-State: AKGB3mKSpcFAzD93eUgDRhwcymG+/QwE+pT7EE9WkfItwy+h9bnULLcN ilT52w9Z2M+EfrBgGwJSXFjdj7osgkQOqILkFebiLg== X-Google-Smtp-Source: ACJfBou9TiuM0KgHuLWgt/eR8AMK7WW9G2xMar5zLgyTFLtXyOJysT4UovQ2Ut0CXsAFzAMZZDzNmBfLl6sdk8dxYI4= X-Received: by 10.28.11.6 with SMTP id 6mr454221wml.135.1513630087021; Mon, 18 Dec 2017 12:48:07 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.28.21.68 with HTTP; Mon, 18 Dec 2017 12:48:06 -0800 (PST) In-Reply-To: References: Date: Mon, 18 Dec 2017 13:48:06 -0700 X-Google-Sender-Auth: rG8f_M8qFcQCAhxagxTyxb21lJM Message-ID: To: Andreas Hennings Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Covariance, again From: levim@php.net (Levi Morrison) On Mon, Dec 18, 2017 at 11:52 AM, Andreas Hennings wrote: >> I believe your algorithm fails on this simple setup: > > Another comment I want to make here: > The examples you give each have multiple class declarations per file. > I would personally not care much, if these result in fatal error. > All of this code used to be illegal until now (because no covariance > support), so it would not be a BC problem if some of it continues to > be illegal. Just because it isn't a backwards compatibility break doesn't mean it's a good way forward. Right now people have covariant returns - they just don't express it in the signature because we don't allow it. Wouldn't it seem odd that if the bodies of the methods stayed the same and all they did was update the signature that it somehow breaks their code? I have some ideas about minimizing this impact but I really think we ought to tackle covariant returns and contravariant parameters at the same time. Any endeavor to add one should add the other to create a cohesive design that works in both cases.