Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115712 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39057 invoked from network); 13 Aug 2021 22:56:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Aug 2021 22:56:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF9911804BD for ; Fri, 13 Aug 2021 16:27:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 13 Aug 2021 16:27:17 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id z2so22942116lft.1 for ; Fri, 13 Aug 2021 16:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=K1+IfrNTyQV/fx4AL2l1XK2BvKsLBuXSqHm0POP10F4=; b=jYfguUEpskvWc2RPm+GOADItf8FJOsus4rs9t0bvmdqBsBucf8tEE1mDfzrUSshTl2 CAsOEGN5lBg1z2ag4fV8gpO1zseY7ciajlhX7qvsbBcS8yUGGcT435nG4yVNJHUfTXob eDa0N1DZDxz0rxBvO849/3yyH9fuv9VnNMoPWipmh7G3hM6IfzixzMXyKCm7Jl3FUaYO lMuSnpicGqtu9GBIeBZMhHP7+AkeYgLcJSrcVObJP7Fc17Z5V9VNQqMAIbw9j9duIIsa TT7QKDVBbJs/G2eWQdd+bxGGxd13O8V9UZ8jgVdD9oO9GfzNOy0atzBLSpVaKBIIVtHU VB/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=K1+IfrNTyQV/fx4AL2l1XK2BvKsLBuXSqHm0POP10F4=; b=Ml35LeNRhyI+Uzyn1Q0eSZ+do5ETuZQaYdba3hU0GEyhT6xLFgdgfHlnsnEWsFkU0o 4WzwzO0B8/9KzFsfit6LdnrATGv7ZsV+3+XCgN9LVt+634WilFhmnP5Mji7Lxk0XWSN6 NyihNiya+T33qfJSCXqAboSFcrfn89RyrovjqLD7d3KMRrWdz9Bd2/CftEkIFbBen2UN Px/Md8RwpI4YkMsBImctz7oIFeCVMwqJfi99hKzLpMHRUP5P8yR+iOLAu2F5XPPe3hme h8sIo/YdMcviTCMJ/TDq+pnNISLawMdgOxnkbBNY8CiEXl78VauWcHAGAiuVwWaFKU82 BtTw== X-Gm-Message-State: AOAM530toWdzC3Qqb7qlGRoel2cY0kSOmueq2XC+7cFORm40o+21sVcN det7tf6VhnXV7oLTN0iyqH3EaWpqZL9tmu3PlgoZkplBE2RaPw== X-Google-Smtp-Source: ABdhPJz8lNjkvqR3LiuNUHCCchDswf3NgoZ3zWgMcQcZ+s02legfsxWcBpwfJYqpHxO+9baDSFvBpYZaZvICiXZfDLw= X-Received: by 2002:a05:6512:16a0:: with SMTP id bu32mr3347659lfb.322.1628897235671; Fri, 13 Aug 2021 16:27:15 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 13 Aug 2021 16:27:12 -0700 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000001b9fc605c979310d" Subject: [RFC] Never For Argument Types From: jordan.ledoux@gmail.com (Jordan LeDoux) --0000000000001b9fc605c979310d Content-Type: text/plain; charset="UTF-8" Hey internals, I've been working on the draft for my operator overloading RFC, and in doing so I encountered a separate change that I would like to see. That is, the use of `never` as an argument type for interfaces. Since arguments in PHP are contravariant to preserve Liskov substitution, `never` as the bottom type should indicate that implementing classes can require any type combination they want. This is in fact consistent with type theory and set theory, and is how the bottom type is treated in several other languages. In this case, the bottom type would be used to indicate covariant parameter polymorphism while not conflicting with LSP. This would provide a sort of minimal form of generics to PHP without the issues that actual generics present from an implementation perspective. It would not, however, restrict or hinder any future RFC for generics. This is at the first draft stage, and I currently have the RFC on a github repo to allow for easy contribution and collaboration. Any feedback is greatly appreciated. https://github.com/JordanRL/never-argument-type Jordan --0000000000001b9fc605c979310d--