Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109515 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15380 invoked from network); 2 Apr 2020 15:25:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Apr 2020 15:25:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5CE6A1804E4 for ; Thu, 2 Apr 2020 06:52:37 -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-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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, 2 Apr 2020 06:52:36 -0700 (PDT) Received: by mail-lj1-f174.google.com with SMTP id r24so3322547ljd.4 for ; Thu, 02 Apr 2020 06:52:36 -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=wb3Aa0ze8SnXSC3voq0cma86j/kpbPtg6Nn5bUXhcY8=; b=EnShMMbczmBOLx1F8PEYiXgHolSt9LIdoZ05ckuax11lHcp13/0XIWveF3ExsE1/pi 8wd12s2cGi7kds7rfUAOfTGT1IsA3CnsYZ1YFuHx4H8ixlWiGhq1M7JdBdJxS8mB4P9m gi/JrQNx+t+5qGzX3cf7NVp25VyC8KR+uJoTjwxEGuBVCSYn6BngEvB374x/w5n0FwT0 SQnwf4RMVG8LXUPjtKAJ10BJLqK+Q8am/mAboJ7SBq0WK4/lNclZwYmOfG+JXKf3x0i2 p1AVSNo7en3Z/ohvr3fK8m9ys74EMYRfuAqHnspMwc8qhWMXyXt6np5BvVnbPmHzZ1u+ iGmg== 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=wb3Aa0ze8SnXSC3voq0cma86j/kpbPtg6Nn5bUXhcY8=; b=INeQxLp2Tr9jOpScVv1QLhPDhHZAKVKhtX1ZkbPAaHBtXrtkY1UQElQsEGzuDmAdg5 VEKNUaBwQwZ0Qkl+nNvqazH8PGdc8CEEqkrsILlFPQDFsHwtFGCHXtgBXWSCK1GVJJBl AOVwv1kePuBTus10ysoqIqK0//l+ZIYQmKVsll5IUGWUTK0ULXAW3mot+qw1imtTljOT qORLXj1nXNWsi/5+gPlpkJJ9ylSSzOjcqMSdTNBG+Ef7LavJyej1KhxKSYri76ppXR8K p+fKI2sFtC54PzcMhxfO+cbm8LjUYis75yosuqxXUqLa6vCenjwBq5VGQQ5JuVXM9IcW wi4Q== X-Gm-Message-State: AGi0PuYQKOZJX6GSmUMfkSvkOyW+VKT9MgGeP69Cx6P1umvRtMctvZw2 tLS+cSueeu96gEi/eOxOz5U4BxiHuvEP0pePhuJoB+IX+GM= X-Google-Smtp-Source: APiQypL7Up1lak8w4ETjakLpsfL5Mt+GsHziIlJqpmiexBLzNHovtLCZ0eAA3FX4yO2AV/9xCWEFOADSPF5yAwfCLp8= X-Received: by 2002:a2e:9b41:: with SMTP id o1mr2063981ljj.145.1585835549863; Thu, 02 Apr 2020 06:52:29 -0700 (PDT) MIME-Version: 1.0 References: <5cb01a17-ff6d-b072-30d3-6a891dcc5434@fischer.name> <90a167b7-a848-1a95-9255-862239509283@fischer.name> In-Reply-To: <90a167b7-a848-1a95-9255-862239509283@fischer.name> Date: Thu, 2 Apr 2020 15:52:13 +0200 Message-ID: To: Markus Fischer Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000009f4cb605a24f1c38" Subject: Re: [PHP-DEV] [RFC] Constructor Property Promotion From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009f4cb605a24f1c38 Content-Type: text/plain; charset="UTF-8" On Thu, Apr 2, 2020 at 3:47 PM Markus Fischer wrote: > Him > > On 02.04.20 12:07, Nikita Popov wrote: > > Reflection will see the state after desugaring. That is, it just sees > > normal properties and normal constructor args. I've made this more > explicit > > in the RFC now: > https://wiki.php.net/rfc/constructor_promotion#reflection > > Thanks! > > Another one, also related a bit to your PHP-Parser (?): will the > tokenization process "see" the code before desugaring? > > I'm wondering how automated translation tool can detect that a certain > code is not "sugared" and promote this? > Tokenization and parsing both happen before the desugaring, they see the code in its original form. They would detect promoted properties by checking whether a constructor parameter has a visibility modifier. Of course, tooling might want to perform the desugaring transformation internally, so it sees a uniform representation of everything. Regards, Nikita --0000000000009f4cb605a24f1c38--