Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108904 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 5840 invoked from network); 9 Mar 2020 09:54:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Mar 2020 09:54:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DD2C91804D3 for ; Mon, 9 Mar 2020 01:15:00 -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-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 ; Mon, 9 Mar 2020 01:15:00 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id u12so4723432ljo.2 for ; Mon, 09 Mar 2020 01:15:00 -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; bh=WKQYW6qAmlfTfUzM+ucDf4ad4XCAR4eMx5cel6DSmv4=; b=jqVjtEuOGNCd36WXSDbMR72dmdPVfRlnWRWMXWgnA5ZTW3Y33qmm4dpQjsLhBn2aul TQrEeivza1KaCkLtbAUAgdMvLKsA6tUz/hZvUh+ru7Yrw8Mq7E5rc3iAtcJvU/lhXVUN ZmIfTL+zpFpK4uQRWlSmDj/GlwsnYQZYnhmey8pO6H534f3GcUXjrXlUaq0wJIb474DO 802uOk60arPAnMuMGgqtLS0jG2cjZSTUj/jlec1xvNOgWuEaAPcgqPY7dFiqjrbtAYxS K3DgugGNS8AWDqzDBbsU9Wc9po0zzNXyHVzMVBE3/KE5Cs+HcGtMoW0hytQvqV6Gi/R/ cfRA== 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=WKQYW6qAmlfTfUzM+ucDf4ad4XCAR4eMx5cel6DSmv4=; b=UasdcdNGHn22RFjQLQbAo1Lj8V3Yy8xmEkcndH7W8L9E2/Dlxyb73AA8CicMaF/2Fh Q/UUotSt3VuEdYOrM7nCMrwcGNJ+nUTHCtZ8zY5vp4OKbh1JbOiPFUpDDXSO/DvA5Gbs U8GSh0ZKYK9kN9vVDXruw2tVWtsq7oZ60E29iOCLqIuKIXCXb3fUkJCSz8rWDfDC1yHu ERgFJo76ene1yvxjYfqSMsCpvYz5/VWr9pohGHdD6d39ND3ry48CQfLaS38stmzmHEWr KA3EgIIdIgEz5IxyH+qY6CyKlzXipPUmmepzfRz1qT9Ub+GRfg2RroFCv0lzxb7A2HgV 5SUA== X-Gm-Message-State: ANhLgQ0xVZrh4jgZyujFINeEmGqU2D8RZ36bK/KDn+neLyXz4vp7r/Pp 8Kbg451Ol8S9AweIbnjJ/lCmz+2h176jCs2tpPc= X-Google-Smtp-Source: ADFU+vvBhEc6ti0c9q7tDUZ7q9Q4sfP8GwuNwEUEJQIKY7zQWpWLaQ7iyZN5ocNJOpkx1DvB22GIBFvvqbwMFB5DQqY= X-Received: by 2002:a2e:b04b:: with SMTP id d11mr9216859ljl.267.1583741695634; Mon, 09 Mar 2020 01:14:55 -0700 (PDT) MIME-Version: 1.0 References: <1845472b-08ab-bb31-dc77-23c620b8d217@mabe.berlin> <4D79715B-D9F8-42F8-B0DB-4EA7B6DBFB6A@gmail.com> <58110de6-9d68-869c-9381-d50c1ea46616@mabe.berlin> In-Reply-To: <58110de6-9d68-869c-9381-d50c1ea46616@mabe.berlin> Date: Mon, 9 Mar 2020 09:14:39 +0100 Message-ID: To: Marc Cc: Matthew Brown , PHP internals Content-Type: multipart/alternative; boundary="0000000000002f2fb405a06799b8" Subject: Re: [PHP-DEV] Bug Wrong resolution of "Late Static Binding" after self::method() From: nikita.ppv@gmail.com (Nikita Popov) --0000000000002f2fb405a06799b8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 9, 2020 at 6:38 AM Marc wrote: > Hi, > > > On 08.03.20 17:54, Matthew Brown wrote: > > This is expected behaviour given my understanding of how late static > binding works: > > > > If there is a chain of =E2=80=9Cself::=E2=80=9D calls that ultimately e= nds in > =E2=80=9Cstatic::someMethod=E2=80=9D, then PHP behaves as if every preced= ing call was a > call to =E2=80=9Cstatic::=E2=80=9D, not =E2=80=9Cself::=E2=80=9D. In your= second call you=E2=80=99re explicitly > overriding that resolution by changing using (self::class)::someMethod, > which PHP always treats as A::someMethod, thus producing the expected > output. > > Thanks for explaining. > > I couldn't find any information for this behavior in the documentation - > Is that documented anywhere? > > Does it make sense? -> I have read "self::" all time as a shortcut for > "MyClass::" until I noticed this is not the case and I expect most PHP > devs would explain it this way. > > Is there a reason why self:: doesn't reset the internal "static" referenc= e? > > > Sorry for all these questions. > > Sometimes the world could be so simple until it turns out it isn't for > no reason. > > > Thanks, > > Marc > See https://wiki.php.net/rfc/lsb_parentself_forwarding, which is the RFC that added this behavior. Nikita --0000000000002f2fb405a06799b8--