Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116228 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 9560 invoked from network); 5 Oct 2021 14:03:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 Oct 2021 14:03:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 370D0180538 for ; Tue, 5 Oct 2021 07:48:04 -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-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (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 ; Tue, 5 Oct 2021 07:48:03 -0700 (PDT) Received: by mail-il1-f171.google.com with SMTP id k13so22061833ilo.7 for ; Tue, 05 Oct 2021 07:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yVsy6O4OZLRjQG2sp8NoucAvwLE4315MsYImr/KshVY=; b=ilv/7HxFvrLohbfl03ki22qpHZ0cNzL07fjdSYb4Gc+gMiOOmnwy9BP4wyhx+roOdr xD9xPOgrr+eNhkmIpqe93QTfQk+klPuVnEXIbP2cJ6VjY6Utvgloz1Rfs1ZC01Nse1Px jwFyZI8PlSLXZVzJin81EBosaTv/8RkL2iHoSel2Kh0xMSMK7GqYf1swudaJmBP8f78y ti7JNj2erVKxEAhbZglZ2jjMawLG9nKEs5QNeT1jwV8w595kklGcXsnExnwUBFaxr7DT YO+IDdvkXB9HWeZS94vylhTbVWfmGXQIVa+FdLaOCx59rIlz0/4upVM4ngXhnulaZlga r6tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yVsy6O4OZLRjQG2sp8NoucAvwLE4315MsYImr/KshVY=; b=tJzMimE/ZptpqZLhXKjIwzz+28uD3jOcw64ladZmQh05iBiJDkZeO5cFyncqo3IGZ2 LInQLEEXaSrnx+TGGi/65HJ94AWGO5AcWkeqoCTSaaXg++q2njp3pGZUYzHTE2drZfr/ MysdU4GtPbHP6lYdHbbQTPIb8Dhnus4EMGJXwKWzzrDOKnwgmshm26FVSMFpzIZoJqmC MQ5uqsZ1Q/ML3qeuFPCwSH/FCM1RlEUKOGDNileaw4Dl/Dh5zJ7QdzwkvUn5NXQ6jw/E Mhgp5oVGlWgKxLzyI3qXb9VJkIUPoDe0B63CjxXFHuWMhO6L2qz1erAIpXQI5OGyBPbT 3fJg== X-Gm-Message-State: AOAM530pp3JzdNI0d+xoeDwcRx2+KHUnjrFotvwbwkyjTdwhjT9iBoUy r3fBZiQfijG/3u5k8PJsgWjAQI/KkmZfNsW4DPHUh0eh X-Google-Smtp-Source: ABdhPJyfS78hhJqGi4Q9RGRqAZH4FgWbG5KzDQMoUB8KzBzr4S/nT8+Q7iBH8pYe2vXtFqaW/mO7ek2kNwptGJFC4pg= X-Received: by 2002:a05:6e02:d8c:: with SMTP id i12mr3034603ilj.190.1633445282340; Tue, 05 Oct 2021 07:48:02 -0700 (PDT) MIME-Version: 1.0 References: <4638866.snJnjoNyIA@tempete> In-Reply-To: <4638866.snJnjoNyIA@tempete> Date: Tue, 5 Oct 2021 16:47:36 +0200 Message-ID: To: =?UTF-8?Q?C=C3=B4me_Chilliet?= Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000d063dc05cd9c1d8f" Subject: Re: [PHP-DEV] [RFC] Allow null as standalone type From: kjarli@gmail.com (Lynn) --000000000000d063dc05cd9c1d8f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Oct 5, 2021 at 4:08 PM C=C3=B4me Chilliet wrote: > > Why would function a(): null|false {} be legal but function b(): null|0 > would not? > > This is inconsistent to me. And adding null, then false, then true for th= e > sake of completeness feels like avoiding to treat the static value as typ= e > hint subject. > I'm not opposed to having values that aren't objects. Feels like a shorthand notation of enums, or the subset thereof. ```php function getType(): 'dropdown'|'textfield'; function getExitCode(): 0|1|255; ``` --000000000000d063dc05cd9c1d8f--