Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115991 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94003 invoked from network); 7 Sep 2021 11:01:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Sep 2021 11:01:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B6F291804C9 for ; Tue, 7 Sep 2021 04:38:55 -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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) (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, 7 Sep 2021 04:38:52 -0700 (PDT) Received: by mail-vs1-f50.google.com with SMTP id p14so8012128vsm.2 for ; Tue, 07 Sep 2021 04:38:52 -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=ESbGwBCa1LWaUnYvpk1795Igh7PGSU0e6BLhy258Z/s=; b=FMVnt+tMohYPPrsIbqjBuv4KMqSLKnZMcqUrvVItK/KwGDKagCYUu+y0bWef6SN1/f wlxb9rtlBxMBaZmyQahM2p1VBhW3tGnLdyN/U3kphSCrjiB9H6Mprs9snzqs5uNx1HBr rrET7UudlGCyC3Mtadz7S5zOIDUSU7Z1DsHmOo3naOBE1Gj8OMn+q/buhmREywRRdvYw sADX1J7KCHHyBgatGXx/9bMlVLiATjtc5IK+oseNg+MFV9tQlUWHA8ryMunrfdSW2nx+ KA36J5f8Kn0bJRxWRxKjHzW1qpeWqq+rhJD72SqEKUUGzsPQ65y7xGnydtpCREubp0vQ av/Q== 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; bh=ESbGwBCa1LWaUnYvpk1795Igh7PGSU0e6BLhy258Z/s=; b=MMUJqFAo48MpvR7RrS1c1iROK9xAeZwbc7N2MGWyacY+cMltFtnzOc04fDmwhC5x48 lM2qrObpkoiZAhlxzjRtbV3m3A33M1A+OW1metVR1+OmUGyMSd97PDFWQgRqOFM7t0sb AojqEMOVkdE5EyYehw0EctZYAJMmL3f1K3DmxzzIRK/L5fDXcdfZYuysWMRmqJgESD2u 7johGZ1fAWKZzF0/d/gqjEW75KKVc7MJdd/d6s7GPfL9F7xpQ+KlQC7hKAU5nanv47eD x9yCqEr9b5eq/sakEFac+qxxrszwRiTQv+gWdYJ1W54dynrcLJnR0GVnNgkwXlbk8p+7 wCWw== X-Gm-Message-State: AOAM531s+qxtBtXla+m8D8wIn2UNfkGMd266/r/FiPkFKYbvgOWnSECm 4iSmXRz8YABEqtDU/dsC/gRZXSXaM2fEehvan3Y= X-Google-Smtp-Source: ABdhPJyg05AjG62juI3PHHdJmdeWiVzNK2xhR/uiBg2C3S6cTDShTGjcQcKDs8csRSnSK9O3ozvOPN+nDar6/wK3XTY= X-Received: by 2002:a67:dd90:: with SMTP id i16mr8016120vsk.41.1631014731491; Tue, 07 Sep 2021 04:38:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 7 Sep 2021 13:38:40 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000b1af0605cb66358d" Subject: Re: [PHP-DEV] [RFC] $this return type From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Marcin_Brzuchalski?=) --000000000000b1af0605cb66358d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Nikita, wt., 7 wrz 2021 o 12:29 Nikita Popov napisa=C5=82(a)= : > Hi internals, > > I'd like to pick up a loose thread from the future scope of the > https://wiki.php.net/rfc/static_return_type RFC, the $this return type fo= r > fluent APIs: > > https://wiki.php.net/rfc/this_return_type > > I have some reservations about this (which basically come down to $this n= ot > being a proper "type", so should it be in the type system?) but I can see > the practical usefulness, so I think it's worth discussing this. If the aim of $this return type is to force and check the return $this why would we still need/require return statement to be obligatory? Does that make sense to assume at the end of function flow the return $this; statement to be present by default if the return type is not an union etc.? Cheers, -- Micha=C5=82 Marcin Brzuchalski --000000000000b1af0605cb66358d--