Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107324 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 65055 invoked from network); 26 Sep 2019 10:26:58 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 26 Sep 2019 10:26:58 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 13D0D2D2000 for ; Thu, 26 Sep 2019 01:06:19 -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-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) (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 ; Thu, 26 Sep 2019 01:06:18 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id l21so1164763lje.4 for ; Thu, 26 Sep 2019 01:06:18 -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 :cc; bh=90YEGLD0/maNcKRAOhBTmFHYn1e6N50sfq4Lolwfiw8=; b=LciRsOuWxQzWsusIZafgDRQjLw5YgOG07btYXlkcBJI+L4wVwc/flpnHhbxYcNEREc RzImuTCkOjxG1OaSY3pr2yW+mD8B3sCJrw6+1Uvm0338nKAwsBjmC+oX4Ah/qRhi6qiF /dNuoWDjYPcXAwXchOVoScjQyQFhOUqa4HRRI2kI30+Rr1YuEteo1fXGUPY6lp5JIHRU NWc+lf8NuUM93rb+v7I8No2qRW2v0mOBobZszC4ZCPPHPBolB5MwnyQaN4ATuYNqUoRB 8g2AcR+HswQ+aS9g6NGj4TZPB3wfI7C4Aot5G/zAK7n90cZz7+pbgOagSHCNotWshTrZ PBLA== 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:cc; bh=90YEGLD0/maNcKRAOhBTmFHYn1e6N50sfq4Lolwfiw8=; b=V+ahs6ynlmAj8/XayLVwRQeaZapzkh+tPO5wsZgD081QpKDxOsgEXUujQ5bWCkQaBC kyL7UMcHYHaVpHDhxdS4jRN7Aw04hzBjCWNBNKobROWSNcRyoFXGFVnz3KHacwyfN60H BET0uS96qgC6DcOu8t4lbLH72WDoRqw5exOYmzdfOlCFZiyphAKPI03J0cgW7X25eeir YDSyYHqMC6G1aANLpDfkMTdq31aHOVAfissbCn/mc6zmadrGjTtYJwlYBpHYAfH6xD+6 edgmHRlpj7SXWlQIkcN8j7ZmB0n5cy9PIx8JatU5sSUk+V4WSD8+7BYjIx3ej8m3rRZE jyfg== X-Gm-Message-State: APjAAAVYqRqFTPAkv8fpgsBoVNCQjIvfDuDTga2Q2+DvfO+ljutNK292 svfVR/Gej9GYTpcOpiuPBoVWq/vtvBs3ACqQJOE= X-Google-Smtp-Source: APXvYqwr/t7J+euQ0W7mATgWzwePXiNGcc6h/MBM8HgkDL6c26rgW2wMyTBRdUd15nWU5T01dNUEwzDE/ZOsZvXXVFI= X-Received: by 2002:a2e:7a16:: with SMTP id v22mr1629481ljc.61.1569485176909; Thu, 26 Sep 2019 01:06:16 -0700 (PDT) MIME-Version: 1.0 References: <1544E25D-630F-4E02-BCF1-1A0DEF1EBD60@gmail.com> In-Reply-To: Date: Thu, 26 Sep 2019 10:06:00 +0200 Message-ID: To: Sara Golemon Cc: Claude Pache , Benjamin Morel , PHP internals Content-Type: multipart/alternative; boundary="0000000000007332660593703ed5" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Union Types v2 From: nikita.ppv@gmail.com (Nikita Popov) --0000000000007332660593703ed5 Content-Type: text/plain; charset="UTF-8" On Tue, Sep 24, 2019 at 10:06 PM Sara Golemon wrote: > On Tue, Sep 24, 2019 at 12:24 PM Claude Pache > wrote: > > The choice of supporting precisely the two literal values `null` and > `false` > > is not arbitrary: They are the two values that are the most often used as > > sentinel values (for indicating failure or absence). It is true that > `true` is > > also sometimes used as sentinel value (more rarely and not among the > > internal functions), but the same can be said of other literal values > > (one of your examples includes `0`). > > > While I personally think `false` makes sense as an allowed "type", I also > don't want to see the union types RFC get held up on such a tiny detail. > > I would propose either of the following alternatives: > 1/ Remove `false` from the proposal. It can always be added at a later > time, but not taken away. > 2/ Make this detail a sub-vote. I would suggest that this sub-vote should > also be subject to a 2/3 majority in order to pass. > > -Sara > This RFC is currently held up by a lack of implementation. Once that is done, the RFC will go forward as-is (barring any novel concerns). Because I consider it an important part of the overall proposal (*), I will neither remove the false type, nor split it into a separate vote. People may vote against the whole RFC if they disagree with this aspect, or any other aspect of the proposal. Regards, Nikita (*) While certainly not the primary reason for why we should support union types, the reason why I brought this proposal forward at this time specifically, is that the lack of union types is a blocker for my pet project of providing comprehensive type annotations for internal functions. Supporting "false" is strictly necessary for this purpose, because it is part of nearly all unions as far as internal functions are concerned. --0000000000007332660593703ed5--