Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19829 invoked from network); 26 Nov 2016 15:54:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Nov 2016 15:54:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.218 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.218 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.218] ([81.169.146.218:36830] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/C1-21589-D20B9385 for ; Sat, 26 Nov 2016 10:54:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1480175658; l=3105; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=bgjgr+LSEoW8B6TT1KeyND+ob0oMLX/os9ZEzOmP1MY=; b=Z0kyfL9dPjkgYNZN3YhMex/cXnsFSuZVNZA/VxGum/s6rxZVgzrTRWsYwl9HZnvPrL sWN1nXYV2JKm9wZd1WPBHoBE754MiNThsnS0HoaEjjIht6Fif06g54saCdHLExcYDQWx DJYXt2+0LYZFIikXHhk8RPihISPQnxPoHB33o= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoNPBqD/t9k= X-RZG-CLASS-ID: mo00 Received: from mail-wj0-f177.google.com ([209.85.210.177]) by smtp.strato.de (RZmta 39.9 AUTH) with ESMTPSA id m055dasAQFsI6Q1 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sat, 26 Nov 2016 16:54:18 +0100 (CET) Received: by mail-wj0-f177.google.com with SMTP id v7so80939880wjy.2 for ; Sat, 26 Nov 2016 07:54:18 -0800 (PST) X-Gm-Message-State: AKaTC01ABkPHjY3DjPErRYXzP7xio6E2u5LpxLUpVPAOCU8knfCMeCGUH1l5SrqmBmLW4zMDPSPVGVkD0o7w4Q== X-Received: by 10.194.201.133 with SMTP id ka5mr13004583wjc.151.1480175658640; Sat, 26 Nov 2016 07:54:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.135.133 with HTTP; Sat, 26 Nov 2016 07:54:18 -0800 (PST) In-Reply-To: <05c849b4-5d84-f77b-7fdb-09ecbe9dc07e@gmx.de> References: <05c849b4-5d84-f77b-7fdb-09ecbe9dc07e@gmx.de> Date: Sat, 26 Nov 2016 16:54:18 +0100 X-Gmail-Original-Message-ID: Message-ID: To: "Christoph M. Becker" Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7bae41ba56af5f0542364024 Subject: Re: [RFC] Parameter No Type Variance From: me@kelunik.com (Niklas Keller) --047d7bae41ba56af5f0542364024 Content-Type: text/plain; charset=UTF-8 2016-11-21 12:59 GMT+01:00 Christoph M. Becker : > On 21.11.2016 at 10:39, Niklas Keller wrote: > > > I'd like to announce a RFC to allow omitting the type declarations for > > parameters in subclasses: > > https://wiki.php.net/rfc/parameter-no-type-variance > > > > PHP doesn't currently allow variance for parameters as checking these for > > compatibility isn't possible on compile time. > > This limitation is caused by autoloading and doesn't allow widening the > > accepted parameters. > > > > This RFC proposes to allow ommiting the type entirely in a subclass, as > > dropping all parameter constraints is > > always valid according to the LSP principle. > > Have you considered that instead of simply omitting the type > declaration, one would have to mark the omission explicitly, to still > get a compile time warning in case of unintended omission > No, not really. While we could use "mixed" there, those signatures _are_ compatible without it and shouldn't throw a warning. Anyone else interested in the usage of "mixed" as an explicit type declaration? --047d7bae41ba56af5f0542364024--