Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116025 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 18553 invoked from network); 9 Sep 2021 14:09:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Sep 2021 14:09:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 52061180505 for ; Thu, 9 Sep 2021 07:47:31 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 ; Thu, 9 Sep 2021 07:47:30 -0700 (PDT) Received: by mail-qv1-f54.google.com with SMTP id w9so1268238qvs.12 for ; Thu, 09 Sep 2021 07:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RoKWOImMNv1hPiriV0gSf6U+dQ9KxMMh3wp/r55+QxM=; b=nbV9UewDM1BXTnNyaTPSN2lbKvoXJkOVBQHnZ1K6SURmx2w+/t/DHKIVgLDamj9K3v kuAOs0JjFBceX3EtGuJq8SseGUTYPMEoRhodssJ2hOgtyDT3le3fH7NethFv30mRG0Km boPtJUmr+CONA3m73fPyEW/Xxvu6s3i9A1l3xqcHIQOEpqX052gat6CImbmnmeX4PtG0 KIBcM20eO2p9fd3xxLZkWV22T9Ne6oi04BiLa/G+tJszJ2R501DGYoksJKLvvC+jFizf eOSj42VvxEi7tGFq3C2HotF2sM0FvjrTz0EMWngIdr4zC721wbmHxXaSPY7SGkRStucf VaTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=RoKWOImMNv1hPiriV0gSf6U+dQ9KxMMh3wp/r55+QxM=; b=W2vdjwkwp7hIUthy/fYJ5QqtH+DzxYH/uGGWklBT4wh8pPtzuSp07GBE4R3bYkDx1c 0LRhPzRgWTCscKK39Hcc+pkRBWDBE7IZUe7tSmJseEbjcirXUuUuqGszph24QPPREnkD e8Wh9kuOf7Dd4sVh1z7DGbGt9l1aDedYppta/ZD0WxeSJAnWmlmzrPsBdpQyyatU8tTI yFAbkbddxsu0TIfjrYnUkoWvX+BwYDhDnZIM6NftEQmHHvqlxpOQWsl3Y9SZLNjRWqPw 1bI1W8BkwUSDbdBpKjDscv/+BQnEhhiUh0/CjDJUbpXxIuHpEdOIkKlck7QGLyPIUMGP GBjA== X-Gm-Message-State: AOAM530RrnRUr1A9sqHupVKYnhFcEpnw7gQ0Zs7AkFNkJ2xPO+ndWLjk AU6X5RQ5fSyqeASQ+EcPhVqzjqEz+axYznnf X-Google-Smtp-Source: ABdhPJynEqf9tciJgx1VhxkIQrCT7q5WUJ8TNgPfTF1xSCEwcvOfXHzLpOv0j8SakdW0Nhs5iTevgA== X-Received: by 2002:a0c:c290:: with SMTP id b16mr3298740qvi.64.1631198848017; Thu, 09 Sep 2021 07:47:28 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id c72sm1484743qkg.5.2021.09.09.07.47.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Sep 2021 07:47:26 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) In-Reply-To: Date: Thu, 9 Sep 2021 10:47:26 -0400 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <30A88C4C-2156-43A9-A4AF-5EBCEA3ECCF8@newclarity.net> References: <75e31735-f082-5b05-1df3-40f14e0e9351@php.net> To: =?utf-8?Q?Fl=C3=A1vio_Heleno?= X-Mailer: Apple Mail (2.3608.120.23.2.7) Subject: Re: [PHP-DEV] [RFC] $this return type From: mike@newclarity.net (Mike Schinkel) > On Sep 9, 2021, at 10:26 AM, Fl=C3=A1vio Heleno = wrote: >=20 > On Tue, Sep 7, 2021 at 10:27 AM Sebastian Bergmann > wrote: >=20 >> Am 07.09.2021 um 12:28 schrieb Nikita Popov: >>> I have some reservations about this (which basically come down to = $this >> not >>> 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. >>=20 >> I am not conviced that there is enough value in this to introduce = syntax >> for it, but if at all, then please not "$this" as the name for a = type. >>=20 >> Off the top of my head, I think that "same" could make sense. >>=20 >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: https://www.php.net/unsub.php >>=20 >>=20 > Hi all, >=20 > I'm sorry if I'm being naive, or simply put dumb, but the main = difference > that we're trying > to achieve with having "$this" (or variations of it) as a valid return = type > as opposed to simply > using "self" is to ensure that the underlying code is actually doing a > "return $this" rather > than returning any other valid "self" instance (such as "return new > self();")? So a *mutable* fluent style vs. an *immutable* fluent style? -Mike