Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108205 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40782 invoked from network); 21 Jan 2020 09:03:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Jan 2020 09:03:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3E542180531 for ; Mon, 20 Jan 2020 23:12:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 ; Mon, 20 Jan 2020 23:12:08 -0800 (PST) Received: by mail-wm1-f53.google.com with SMTP id q9so1739267wmj.5 for ; Mon, 20 Jan 2020 23:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seld-be.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=iLEsvaYrksSdpP/3Jp0o+679v+jxJwoMncAs0Y3YMhE=; b=blyaDS0PD/aCnrmKbQr8EZ8v8Bq3qyDue+cRjVMQ3LOmFlzH2SwRr/IEOUbJGqN/yE LayF/e3zPBgpleLtVOejGwkFPI2Jke6Cf8U/rVLQRoYp61Sv0tW4b0aDxvaD9wEy1Iud aKAL9PHwG0ugwgXDN1j6pkQT+3nRaXwoVVYzeY2IU1CnMI2V1T5kFkIRVQirMy8ljp9E ixc8wB426tTJo7mkYIE4FhzHTN9MX48lVTSCJd3ok8AHoyPsQHFojlzLlnhSPWv9KxcE kO3CYi+BnDBG2u6LtiWb9gqMc57Jl9F2ptlG55l6/XFakFXCotD7/ud2mbhlLgp2QYGf XVJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=iLEsvaYrksSdpP/3Jp0o+679v+jxJwoMncAs0Y3YMhE=; b=sNqADinK3be8N9wem0EljYBOaSzqCrz9QWdrd+SUguWQaWxcGr4Iss1G4JJOZ8Y+NS NDK9HSnWlhBOoYtmeVeM8QkzidEhmlXHi84EKz3B7S/EkSZZ9Gu8PuM5awNqKncupSdl 8kTuhD+81lhqwAC2/Mu66fyvNXLpfD95FPqzqmyKjxOyo+gjXeqU3INCDndewB+BoqRO QhaWrgMmmJJlyEjnnnyee/7Rn7e7xNTQj9ViQFDyqjYNqaWXGbWvYKhllE7RpVdI75cm YjfZFRPT4D7H8uJmyGPoychgieD+UI7dpDtVpLimnjesC/z9VPN04aRWW6UenTJUXXSU QRmQ== X-Gm-Message-State: APjAAAUBQMP6TrG8ey+UPRb3qFPKKrc+hNscK7AFRcxGhjDmlw8rt8Zr 3nBj8v9zveoo5XfZgUqh3LGnGiyZbdwz5Q== X-Google-Smtp-Source: APXvYqziZQbiZmibFMZnTFTS48z6GHZuPny0p2gwU0BW0OhqOoFpIeXq+B8wEDrTVF5fxqMt37sFyw== X-Received: by 2002:a1c:de09:: with SMTP id v9mr2819286wmg.170.1579590725207; Mon, 20 Jan 2020 23:12:05 -0800 (PST) Received: from [192.168.2.171] ([217.22.142.136]) by smtp.gmail.com with ESMTPSA id r5sm50241360wrt.43.2020.01.20.23.12.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jan 2020 23:12:04 -0800 (PST) To: internals@lists.php.net References: Message-ID: <78bc1377-3970-d339-9002-4c82aff83703@seld.be> Date: Tue, 21 Jan 2020 08:12:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [PHP-DEV] Union types | true pseudo-type From: j.boggiano@seld.be (Jordi Boggiano) On 20/01/2020 18:30, Benjamin Morel wrote: > I'd like to bring back the topic of supporting "true" as a type in PHP 8 > union types. > Now that the RFC has been > successfully voted, I'd like to revive the discussion about adding the > "true" pseudo-type in addition to "false". > > [..] > > Thoughts? > > — Benjamin Hey, Looking at my current project's code, I found one place where we use a "string|true" as return type for an authentication method which returns true or an error code if it fails. Of course all the use cases we can argue about whether they are valid and so on, but my main problem is the weird state of having false as a type and not true. It just feels like an inconsistency in the language that'll surely bite people when they'll try to use true as a type. It might not be often, but it's kind of a shame if we can foresee it and prevent it from happening. TL;DR: true Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be