Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108040 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42679 invoked from network); 8 Jan 2020 23:06:23 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jan 2020 23:06:23 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 17D7E180543 for ; Wed, 8 Jan 2020 13:11:54 -0800 (PST) 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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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-yw1-f54.google.com (mail-yw1-f54.google.com [209.85.161.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 ; Wed, 8 Jan 2020 13:11:53 -0800 (PST) Received: by mail-yw1-f54.google.com with SMTP id i126so1837888ywe.7 for ; Wed, 08 Jan 2020 13:11:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benramsey.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=9isBRLyhGjgCCqbXnVT8ZVU6ngeYkras3Jvd2CoJxO0=; b=COdsLdd9v2jSk/CZL3gQWwIrdvMXxxmYs5ZEPyNt+ALZhQGWZVa+ixxyVMjUKQiIzZ 8d+WhJLHYJs40tEf6lXkjouN5lg5FK5shwwCokdmLONK+D8iXiiJfVYRZTt7IhgB3vN8 AUA8zArhc823/o9EPr6P1sMD0JK83zt7Q71Y5YxTta4F5wWcVJhljjxNskZJ7flAXPiG T0+pWwkKn3Io8YIvf5MW+yERYVBndZWax6ZAJAV3Wl97S1AViHJDa2XQkg8YIwcjdIvD mLERiEOG5l1ypfPoaQ43WMlGvBoLwBJmfCah2VriB/JYcwTuI1aD/X1iq8A0+jZmLOni 8PBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=9isBRLyhGjgCCqbXnVT8ZVU6ngeYkras3Jvd2CoJxO0=; b=khJVFuRQd9PxmAEM9IQGa3wNfeJHPLjD83NgNQnfLmd+qXnzzYPJShuqsbNWAerX4y 63qeLdNEx6UXA5StEyJQUp5h5NnSJ109hMnoMdCzMPGrkigBBu0HXMHQJY0dHMi0ccZo KSShUSUf70lhHk83rei/3I+B531DVWQ6wUZ8+2xtvNv2rc4gEV6MmLUvm998+AdOuj13 9timPKTbrRi1808QapbQOxkWbeqS8bpB5w/ALfVHzktUBi00FvmisSkXvi686eKfgdvJ a2Dp/ZgaTYyWW7+xduJFaJO5D8AY04HrUEL7Ml9bRbrQv7SBvy0VPAjOhBwp3Vu7FnwQ BNYg== X-Gm-Message-State: APjAAAWDgA/9KxtGcfI2YIyWsjKM4P3oVUzdzQfPD/iY5jopNog0rrGQ BrpW1bmcUKsFSSGop2jLgbSFhw== X-Google-Smtp-Source: APXvYqyC2UjVGZZt6SWF9il2O/4zO94E+RacHJUBJsqR0297ASAz+WxaiOOmZtx4mLHlV2ALjAO6ow== X-Received: by 2002:a81:9a09:: with SMTP id r9mr4857838ywg.244.1578517911734; Wed, 08 Jan 2020 13:11:51 -0800 (PST) Received: from [10.10.42.56] (h96-61-170-50.lvrgtn.dsl.dynamic.tds.net. [96.61.170.50]) by smtp.gmail.com with ESMTPSA id u130sm2037034ywc.10.2020.01.08.13.11.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2020 13:11:51 -0800 (PST) Message-ID: <4C221C9A-01A5-4C14-8B1C-A9B87E18845E@benramsey.com> Content-Type: multipart/signed; boundary="Apple-Mail=_C01A3872-6710-4A8D-B85B-65826B306632"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Date: Wed, 8 Jan 2020 15:11:49 -0600 In-Reply-To: Cc: PHP internals To: Nikita Popov References: X-Mailer: Apple Mail (2.3608.40.2.2.4) Subject: Re: [PHP-DEV] [RFC] Static return type From: ben@benramsey.com (Ben Ramsey) --Apple-Mail=_C01A3872-6710-4A8D-B85B-65826B306632 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 8, 2020, at 05:42, Nikita Popov wrote: >=20 > Hi internals, >=20 > I would like to propose the following RFC, which allows using "static" = as a > return type: >=20 > https://wiki.php.net/rfc/static_return_type >=20 > While I'm personally not a fan of late static binding, we do support = it and > people do use it quite heavily, so I think we should also support it = in > return types. >=20 > Regards, > Nikita Yes, please! > For the fluent method example above, many projects will use a @return = $this > annotation, rather than @return static. In my own code, I usually use `self` to mean =E2=80=9Creturn the same = instance.=E2=80=9D While I know that, in practice, the use of `self` is = identical to using the class name as the return type, it seems natural = to designate as practice (among my team) that `self` always means itself = and should never refer to an instance with different identity. -Ben --Apple-Mail=_C01A3872-6710-4A8D-B85B-65826B306632 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCXhZFlQAKCRCwLZeYnIwH G8pUAQCceRRcJSI2hrtrl6VWKIwUopMmAmk0/vUjZYcQveukeQD9GH9EMWppc7ro gapct87CT5m00TAcRv+RZlNEXlOmWZg= =C/dg -----END PGP SIGNATURE----- --Apple-Mail=_C01A3872-6710-4A8D-B85B-65826B306632--