Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107204 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72840 invoked from network); 18 Sep 2019 15:55:55 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 18 Sep 2019 15:55:55 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 5191E2D1FB3 for ; Wed, 18 Sep 2019 06:33:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Wed, 18 Sep 2019 06:33:19 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id d5so7229188lja.10 for ; Wed, 18 Sep 2019 06:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=PH2Xmv0ibrwzHiRnjZPREkq89rElUDth5M1P/8SbSxM=; b=gwu4XcW4lg0LJGKJwgUO6GSellK4Mei2yIZCZT+piI4zXj1pJnuUV/ueuPCBaaKtsu 7otQIyd/Lnm/t0ZDXhWW68hEmwyKARnlJQOc5jzTuYxBN/m4CCP6ZPA3kh526oN1QuzD qbthM9EGuBKGaP4fwRMDfZfbP9cJ71XpZh5BAQzUcn33IwxYX9Hd1rKTkB9PuMV8WYRZ k9U+eZXww4U8yB3hCherfB0MMWTj1zZHJ9ra8iu13lOmgeWk4muJQeL6Y1Xpjt3raBzB Ept6tIFHKRjkoT27sNLwf1opzq/iuIsz0RhJ5jHb13ge3nw7uWqERYl0T7Te1jXFYJMi s9hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=PH2Xmv0ibrwzHiRnjZPREkq89rElUDth5M1P/8SbSxM=; b=EroGg/B+LAFxPjNnG+2LoDzpq5ZCZkpLOfsK/at2Gd4QN99vrR6rWyAcHBF7GU9IMX Bpwlul4DhrIlrwh0rxh4Daj+hU6z3wkIwOBsBEqTfSW0mhOupYqzYEfTI/+ZAVWo2aXY nXAfiA4MWY9KzU8E+yCvGyFVIw6ALMuNFRvhsjkbi/wEqYThie1UQiVbcQ6t0Vyc8Rpw aJcKISWDJG5/cc4/Ze25mlwhoe/Evx3+/zUp14lBSE5Yw3C9AuxE35P6CQvyYDvJxq1I 2hoNegDD5DPI0o7WOez+DoOGefG5CD2e9mEu/Q3QmS0Ym/g5CuGs3vSXBRS3saGOLr0x Z7Pg== X-Gm-Message-State: APjAAAX/JAXJ7NSg30Tnm72Sv3Ox3/t8+yG3KjkRN+wyFMbBGutJNaMO gjp1YDgaH97cqCZ3SBZTPzAmlf3oO0f+poDepd4dUGEa X-Google-Smtp-Source: APXvYqwx3PkZ/FF2WfBLG+imeTTCD+cxqiR7iQUp0SRaojASnW9cKWzCdelG/nZ7D39JDphCWUCmHMYcPuAsbmbz4hA= X-Received: by 2002:a2e:8997:: with SMTP id c23mr2278350lji.208.1568813598256; Wed, 18 Sep 2019 06:33:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 18 Sep 2019 15:33:01 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000003e32b40592d3e1af" X-Envelope-From: Subject: Re: [RFC] Union Types v2 From: nikita.ppv@gmail.com (Nikita Popov) --0000000000003e32b40592d3e1af Content-Type: text/plain; charset="UTF-8" On Wed, Sep 4, 2019 at 10:26 AM Nikita Popov wrote: > Hi internals, > > I'd like to start the discussion on union types again, with a new proposal: > > Pull Request: https://github.com/php/php-rfcs/pull/1 > Rendered Proposal: > https://github.com/nikic/php-rfcs/blob/union-types/rfcs/0000-union-types-v2.md > > As an experiment, I'm submitting this RFC as a GitHub pull request, to > evaluate whether this might be a better medium for RFC proposals in the > future. It would be great if we could keep the discussion to the GitHub > pull request for the purpose of this experiment (keep in mind that you can > also create comments on specific lines in the proposal, not just the > overall discussion thread!) Of course, you can also reply to this mail > instead. The final vote will be held in the wiki as usual. > > Relatively to the previous proposal by Bob&Levi ( > https://wiki.php.net/rfc/union_types), I think the main differences in > this proposal are: > * Updated to specify interaction with new language features, like full > variance and property types. > * Updated for the use of the ?Type syntax rather than the Type|null > syntax. > * Only supports "false" as a pseudo-type, not "true". > * Slightly simplified semantics for the coercive typing mode. > > Regards, > Nikita > Heads up, two weeks have passed, so this may now go to voting... I believe relative to my original draft the main change that has happened as a result of the discussion is the use of T1|T2|null syntax instead of ?(T1|T2) syntax for nullable types. ?T becomes an alias for T|null. People felt fairly strongly that while ?T is a nice shorthand for a common case, unions should use the T1|T2|null syntax that both reads better and is already well-established from phpdoc. I figured I should mentioned this for people who haven't been following the GitHub thread... Nikita --0000000000003e32b40592d3e1af--