Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115597 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37075 invoked from network); 28 Jul 2021 00:47:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jul 2021 00:47:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 53A1F180504 for ; Tue, 27 Jul 2021 18:14:10 -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, 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-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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, 27 Jul 2021 18:14:09 -0700 (PDT) Received: by mail-oi1-f176.google.com with SMTP id o20so1655404oiw.12 for ; Tue, 27 Jul 2021 18:14:09 -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:content-transfer-encoding; bh=tT8FhwQn8nMeVUoP5jzzkFB7djSFuE0HmUSTuqq6XAc=; b=RqRIDIFnMMgjVWcrLiUZYvY9wr3g3/NOxAjuYqidbSZlC8jsA3xorI5YL803RGq5yX JRa/Y2NHatzbsqRR0EeAJKPzPtDGnDFUjQcjNXiSbPh2JhdppVhjoNVYZHJAqc/m3pvN C6muldy/Gh3CwW/nbTAGBqTCilKreZEgxdksdpphkHpAW/TWimPQxZXbztAdAGMVKdgi Y1ZWtT70JGPy7tbSEEERrvD2C5MrYY8ekP2FdUGb4Jep0yqcrGYF6eX7QLcfxC9eCbau 3MrbElNFlJEjl2TOZxzfu024xoUiEEONjjxALdnjCM7HtFJy+9QyhnafO4kbyRLW5mYV wBlA== 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:content-transfer-encoding; bh=tT8FhwQn8nMeVUoP5jzzkFB7djSFuE0HmUSTuqq6XAc=; b=a56YjDOB+eL8L/izxx8lV88Gt2nZHLkL1MPJYK9eCSqMf7I3FFZIdDTFbGoB1uh95v zzFEmgexPbRcfVWXkdhFqZFrE8XXe6ZkO44RwHjU4JUqZIKpISkB9/ktoVpYP5+t2F8s CLfUbpG5yZiD9qGGR3ETN3JtpA0pcy1UnZmuS8PJ+qFQeRiPfHeBLWEs3LNSt5dTjIJI oAPdAx8/i06o7llWmmjhQ7k6UhbM2HY3TkxMZdWLQJdhsfkSbxNp6l3yAG4C4A1c3GNG q37sRM7Rv3OvUxSyeR5209/Zb5B/enIFnfgyeDel/r3D4UTyLw6FREfbmRwirg9y1KHq 7yVg== X-Gm-Message-State: AOAM532p+O+uBgs8xu7Li1QAD86U3g/BefdxULkTpcdxymviDG22NQnz SrQ1N5xmrfKke1HGI67di4OxdBpd/rcEiAPC45s= X-Google-Smtp-Source: ABdhPJwOhm+0aFNc6pmX5t140YUgcw9subhb4OgC3f74d1lcPYXGuCFalewtdxpBOdP0k5UUJtvs0TPAOAxvmWjWDeQ= X-Received: by 2002:aca:1112:: with SMTP id 18mr16613897oir.168.1627434847949; Tue, 27 Jul 2021 18:14:07 -0700 (PDT) MIME-Version: 1.0 References: <002e01d78326$27ed0680$77c71380$@webkr.de> In-Reply-To: Date: Wed, 28 Jul 2021 08:13:55 +0700 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Nullable intersection types From: pierre.php@gmail.com (Pierre Joye) Good morning, On Wed, Jul 28, 2021 at 5:52 AM Rowan Tommins wro= te: > > On 27 July 2021 21:29:47 BST, "Andr=C3=A9 H=C3=A4nsel" w= rote: > >> In fact, when 7.1 was released, none of the signatures changed in my > >code, they were just > >> updated to a different syntax. > > > >That by the way is only because of a specific compatibility behavior > >which is so confusing > >that I erroneously reported it as a bug: > >https://bugs.php.net/bug.php?id=3D80948 > > > I can see how it would be confusing if you're coming to PHP fresh in the = last few years, but from version 5.1 though to version 7.0, that was the wa= y you marked nullable parameter types. > > It's a "compatibility behavior" only in the sense that it wasn't immediat= ely removed when the more flexible "?type" syntax was added in 7.1. I get the feeling the nullable type syntax was not very well noticed by users when it came out. However it is not what is confusing I think. intersection, types on the other hand, are. I have yet to find usages so critical that we had to rush that in in an incomplete manner. I personally prefer how it is done in typescript, but same thought, I have yet to see good code design using them. ;) Best, --=20 Pierre @pierrejoye | http://www.libgd.org