Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115493 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19000 invoked from network); 19 Jul 2021 14:01:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jul 2021 14:01:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A7148180533 for ; Mon, 19 Jul 2021 07:26:30 -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=-2.1 required=5.0 tests=BAYES_00,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-Virus: No X-Envelope-From: Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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, 19 Jul 2021 07:26:30 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id f30so23925071lfv.10 for ; Mon, 19 Jul 2021 07:26:30 -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=F2INF7M5+XypUemFIKIeugPZ2l20WaNtuG7+oDj8eXc=; b=QnBwN4h4cM9LhLb/HVtsHyu+dAgE2LOLyI7LPBlVkRcsDfIgEohNHSZ4438Wj3bQSh cZ0HJyOVWmWGxDosXVzmWMaN4vu+5xx9u20PVa9MW8rM0nBfAfRcoSCSaP1CJXGyb70o tRJz087LcOTSgCvEyw3nomYUOwK91ZMKS6HLDHNZz5YGymW6Dm+X3OKD7yFA6I8BgdEa UKfO3uHrLGd0HJ6gXXNZFq+ouOAizMJnAe6U5kevSXdsObcXXOiJYDmYgsznl3yDvzsX 5NgIyPk7VgNATWskzfZcNeJwOh84apLoyL2bKdRUFQW0NOkHxVI+FtTTLYLluIJHDsab gAlA== 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=F2INF7M5+XypUemFIKIeugPZ2l20WaNtuG7+oDj8eXc=; b=Yfayc6vtVBRdDiZrAPZQwTURchKTAwCNGi+xzmMSkPQx5ljBNkisl7setbbbmmjbuC CT7WQomHzJGkm5L6Bt2KFi2DU0t5sSdX0fQeIuCXK+X8tkYwzM9eepBu4kzkw23A6t0I X/SrGHjQBzTYFhnvtgYi+F6SYOaDLSoxwcX7dJAzlH94QPxXoOfhucycUGeCdvC0Jm8p eXRIA5gTbsqMbOrqjFA+wB8ktIC2C4QFXlZeac7wdMmCymqWDnlym4pLgrlKRvJ2qZ4j QcnupQD2eWHajeAmtVC0/0r23oUeWpdjdNrh0J5tJnrzZBKuJ9u2npCcmUqTUxwhpNNQ E/wQ== X-Gm-Message-State: AOAM532f4lHlxrJqJerH05MomC995mlFGoB6A7GMrlb9neVay7pbEGBu 0mzU+MQ9ooJbreYwwCEw7701QE+h8Uk6OW6OaytJM4mGVw== X-Google-Smtp-Source: ABdhPJxWkhQxDQXChJUO6aVVOIf8u5apr8oumCIfxq43GE85ZMn45uqMqSyJUK4a5z+JDgROtHqT2BZv6zDU4K/TXlA= X-Received: by 2002:a19:6a09:: with SMTP id u9mr18485015lfu.119.1626704785314; Mon, 19 Jul 2021 07:26:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 19 Jul 2021 16:26:16 +0200 Message-ID: To: php internals Content-Type: multipart/alternative; boundary="000000000000e2158e05c77ab8e1" Subject: Re: [PHP-DEV] intersection types and null for defaults, properties and return types From: guilliam.xavier@gmail.com (Guilliam Xavier) --000000000000e2158e05c77ab8e1 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 19, 2021 at 4:05 PM Larry Garfield wrote: > > I can see the argument that "I need something with these two interfaces... > or nothing" is a valid use case to care about. However, as Saif noted, > this is a side effect of the inability to mix union and intersection types. > > So, my question would be, how feasible will it be in the future to > introduce that mixing? If it's something that is likely to show up in 8.2 > or 8.3, we may be better off going "meh" for now and letting a solution > fall out naturally later. If it's something that could take a decade, then > figuring out a way to special case "or null" in the meantime is probably > worthwhile. (I don't know what the best way to do that is.) > You made me remember that [we had non-scalar parameter type declarations since PHP 5, and] we got scalar type declarations and return type declarations in 7.0 but nullable type declarations "only" in 7.1 (but I agree). -- Guilliam Xavier --000000000000e2158e05c77ab8e1--