Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107351 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54877 invoked from network); 30 Sep 2019 12:37:51 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 30 Sep 2019 12:37:51 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 208ED2D19BA for ; Mon, 30 Sep 2019 03:18:13 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3301 81.224.0.0/12 X-Spam-Virus: No Received: from v-smtpout2.han.skanova.net (v-smtpout2.han.skanova.net [81.236.60.155]) (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 ; Mon, 30 Sep 2019 03:18:12 -0700 (PDT) Received: from [192.168.8.4] ([84.55.126.158]) by cmsmtp with ESMTPA id Eskri9lolUYHfEsksiEYO4; Mon, 30 Sep 2019 12:18:10 +0200 To: Nikita Popov Cc: Sara Golemon , Claude Pache , Benjamin Morel , PHP internals References: <1544E25D-630F-4E02-BCF1-1A0DEF1EBD60@gmail.com> Message-ID: Date: Mon, 30 Sep 2019 12:18:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfHZld41bYmMNXmyJ3xd6U2lURU3lapPvnNN5kQAeFxkCVb3VJVkhZ7OrzyRhG+4snJUoR8NO5mCKt5XR04e4OpycFe+BO7SrpxIFKtDUNwWfeEbUYGM7 uNAFQVmr0ZJYCtEr9G6WjddrAgwxpt8xvlfDUXAEUUkipfpag89bAs3clMJzxUK631THybyIdKY8pt+hvi3H++1iTp7SFJS9d1NoP0FuWz6Tvr1zbEoZ1t2z Siz/fobU+DD55VVok6pdxt8+7N6Y3xaRelhofQb2thfWQ5DymX4YEPdvbjYc2wvtCwyXZ6lDROK8QJCPBSCC/w== X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Union Types v2 From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2019-09-26 kl. 10:06, skrev Nikita Popov: > 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. Hi Nikita, Given the feedback on 23/9 from B Morel regarding occurrence of true as a return value, would you then consider adding true as a valid return type in unions? r//Björn L