Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116024 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15929 invoked from network); 9 Sep 2021 13:48:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Sep 2021 13:48:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 67F5C180504 for ; Thu, 9 Sep 2021 07:26:36 -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_H3,RCVD_IN_MSPIKE_WL,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-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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:26:36 -0700 (PDT) Received: by mail-pl1-f181.google.com with SMTP id j2so1178396pll.1 for ; Thu, 09 Sep 2021 07:26:36 -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=NK+f5JZrF8Acu4xM7gagtaowQkfk2lBSCgefWH6/LUo=; b=qU2ispgHPhX4V/8j8moEtPb3v5uiJwJgDAk1XNpB7EGF/yjhaiN+GiCAPsA2NAJrVC b76YaZs2102OKKdll977nxF4ywrbUnNnFS5ygCqDlaB35UXlJGY9SiRN29xWj5veX59y Ik6RD9COcqB3qaxK1cHJY/y1y3ZJijZ3u8mnLPhPg2rFq7WoIHo55GKhSjOXe0w2rZvj IdFnt5/92sr/wiikOIKZi/VnbuEZGTpYK5MblDx/k9FSp82248GsA8J0A3R1FciMgEyu lt65NRPoWOHgyz1HVjzmS0ZZGJnj17PyqZEMbeYzGH2J3euzSuv/2sOUUvdouO5MDAk7 irYA== 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=NK+f5JZrF8Acu4xM7gagtaowQkfk2lBSCgefWH6/LUo=; b=Q6AWVCFjufQ1mFNz/UbYDUd76HmMYk+V+NjRbWQ54wv1zpj9T77YbAEt7Rba0x/NhA MF9YkAEGRdMM3zyuKbLr/k1T4SPadmLigH4hKpRmFJdVaUDKmm4cyJsD5TwlJitDqJbV +R+OHaW+iCIIAxGdXymTLghzg8IwHzg3L/lG7QeNE5PCsNXMvl9n9kMSsVhzu2paK/BM 7iTgn6fXUlgq88TaTIVmp3xzHUDhf3CY4znpnuoGAAj5/jyuil/qVvAklhd905DgXPDh 4qXy7AP3Af8LHUnRRey/0lQknyLrp6jv/0n1ppceZIcFql56v/YCm/BUuntIKd/I4tXN U+TQ== X-Gm-Message-State: AOAM531nerzsl9767+6mmN4MUNySphVFtgbYbSjYQCX1rNjc8AyBm9Hj n+TrqRbS0QeBCAiJNYbpsF3gfGRuthtE4MR20WWNwE7q X-Google-Smtp-Source: ABdhPJxGICBbiig6nO8msvRr5lKT0ShbUR4xHx/4ZY4OE9agooYs1WPvNHqHOzASj14Y5HdKcpz9cpmpIVb5k10Zz+A= X-Received: by 2002:a17:902:a702:b029:12b:aa0f:d553 with SMTP id w2-20020a170902a702b029012baa0fd553mr2962129plq.3.1631197592170; Thu, 09 Sep 2021 07:26:32 -0700 (PDT) MIME-Version: 1.0 References: <75e31735-f082-5b05-1df3-40f14e0e9351@php.net> In-Reply-To: <75e31735-f082-5b05-1df3-40f14e0e9351@php.net> Date: Thu, 9 Sep 2021 11:26:20 -0300 Message-ID: To: Sebastian Bergmann Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000000a350805cb90c9d4" Subject: Re: [PHP-DEV] [RFC] $this return type From: flaviohbatista@gmail.com (=?UTF-8?Q?Fl=C3=A1vio_Heleno?=) --0000000000000a350805cb90c9d4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Sep 7, 2021 at 10:27 AM Sebastian Bergmann wrote: > 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 s= ee > > the practical usefulness, so I think it's worth discussing this. > > 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. > > Off the top of my head, I think that "same" could make sense. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > Hi all, 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();")? --=20 Atenciosamente, Fl=C3=A1vio Heleno --0000000000000a350805cb90c9d4--