Question: Will parse errors in the __construct() be reported as all being on the same line, or will the parser report each as a distinct line of code when reporting parse errors?
-Mike > On Apr 2, 2020, at 9:52 AM, Nikita Popov <nikita....@gmail.com> wrote: > > On Thu, Apr 2, 2020 at 3:47 PM Markus Fischer <mar...@fischer.name> 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php