Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99132 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18211 invoked from network); 23 May 2017 19:51:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2017 19:51:11 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.54 mail-it0-f54.google.com Received: from [209.85.214.54] ([209.85.214.54:37671] helo=mail-it0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/A2-10292-BA294295 for ; Tue, 23 May 2017 15:51:10 -0400 Received: by mail-it0-f54.google.com with SMTP id g126so26724195ith.0 for ; Tue, 23 May 2017 12:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8laaSqSZfF6+LoEA1/KRZe1KblLcz8E25KTEM5CWDak=; b=bqOB8o3eobTkIB5/y9UMd7LnzecKZ6buPDxDhcPp54rJZ9V3PJxpBa2LjD0HP8taoV 4aVbm6xv4YGN4OkW9t8jiGAtt0l0Gcr7yNUXnkqfumobauEl8TKQKfW0zTMbO/Xn5Ut9 0ZDJngokm7JAv4lifDI6ofki2Twf79Sz92NCqE8xi9s5M4LkOLjbEVu7ENsWg2KJHvCj xSlfEVeiwGqkWzGl3WNQHpIMDOKNt0Mb8GZkSCJgwXjgAxr5I/3Jgndohz0SADKxMj6j N7/j/iNtR5J2ZEOBMaODaZ0SH3wVrJqn+HAmhtU+IUK34unmSBmWDIMY9O5v7O9gUCKM O3uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8laaSqSZfF6+LoEA1/KRZe1KblLcz8E25KTEM5CWDak=; b=DKRhNxl6GIv8GpK6JDHx4M3T4xKuTqPA6fzQZ1tNEORpSO+sKSkqn1dvDRJIs5Lckx dFc3dEuc2qsKN8pMbXWFjBuNHK+xO758U3reVkMgkJH+Ji/YtXFekkHXgqeTyxwazO0f ztYtLmS6jXubZa40mvzaeV8qtJuklBYrkac6W6SIzmO3xnXqlUTfPNtQavYti/X2hLQz 4tB1/+InSKH7FjNrIvVbzNLX8/SFvhKo9s1DkpaMaOeO6BTs/Sr2n+8A3EvtftT144RI xYoEQKkm/Lt/dm1MPp6N8IfhkzOsGbmRXlVRX6LUq5Wb2K1JvNhJM1hTfsyS/fWkovS9 odXw== X-Gm-Message-State: AODbwcBJJMV+0lpPzQQXxk6mjHAQtqFW/vRB3R/9G5GsE7P7lhbba3wM noRpUX1LMvxUOVBAlUAjBM+bopmVEpv1 X-Received: by 10.36.185.29 with SMTP id w29mr4711892ite.2.1495569064245; Tue, 23 May 2017 12:51:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.31.77 with HTTP; Tue, 23 May 2017 12:51:03 -0700 (PDT) In-Reply-To: References: Date: Tue, 23 May 2017 21:51:03 +0200 Message-ID: To: Rasmus Schultz Cc: PHP internals Content-Type: multipart/alternative; boundary="f403045d9712cfd5c30550364edc" Subject: Re: [PHP-DEV] Parameter type widening RFC From: nikita.ppv@gmail.com (Nikita Popov) --f403045d9712cfd5c30550364edc Content-Type: text/plain; charset="UTF-8" On Tue, May 23, 2017 at 9:25 PM, Rasmus Schultz wrote: > This parameter type widening RFC, I didn't know about, but I have a remark. > > The feature, as implemented, will allow accidental omission of type-hints, > will it not? > > Previously, the implements keyword guaranteed a correctly type-hinted > implementation - it's now possible to (purposefully, obviously, in certain > rare cases) omit type-hints by accident, making the implements keyword much > less (or not any) of a guarantee that the interface is implemented > correctly. > > The addition of an explicit "mixed" or "any" pseudo-type would have made > this possible, without losing the guarantee that the implements keyword > used to provide - that is, it would have been possible to have this feature > for the few cases where it's useful, without affecting safety in the > majority of other cases where it's not. > > I feel like this feature takes a pretty dangerous shortcut by simply > removing a constraint check that we used to have - in favor of supporting a > few rare cases, we removed a guarantee that interfaces and the > implements-keyword has always provided. > > Those rare cases could have been supported in a safe manner by introducing > a "mixed" or "any" type, which would have made the use of this feature > explicit - which would have removed the risk of accidental omission of > type-hints in the majority of cases. > One of the primary motivations behind this RFC is to allow the addition of typehints (for example in library code) without introducing a backwards compatibility break for any code implementing or extending your interface/class. Requiring an explicit "mixed" or "any" type would not allow this. I think this is 95% of the reason for this RFC, so without it, the change itself is probably not worthwhile. > The RFC page doesn't link to any discussion, and the Github thread was shut > down after some negative remarks. > I didn't see a discussion or a vote here on internals - did I miss > something? Where or how did this get discussed and passed? Are these > discussions happening somewhere else besides internals now? > The RFC was discussed in http://markmail.org/message/2oydyyl45v4korau. You participated in that discussion. The vote started in http://markmail.org/message/jgn4hwcgeezzk22w. Both of those were found by searching for the literal RFC name. Nikita --f403045d9712cfd5c30550364edc--