Re: [PHP-DEV] [RFC] token_get_all() TOKEN_AS_OBJECT mode

This is only part of a thread. view whole thread
  108765
February 26, 2020 06:00 michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=)
czw., 13 lut 2020 o 10:48 Nikita Popov ppv@gmail.com> napisał(a):

> Hi internals, > > This has been discussed a while ago already, now as a proper proposal: > https://wiki.php.net/rfc/token_as_object > > tl;dr is that it allows you to get token_get_all() output as an array of > PhpToken objects. This reduces memory usage, improves performance, makes > code more uniform and readable... What's not to like? > > An open question is whether (at least to start with) PhpToken should be > just a data container, or whether we want to add some helper methods to it. > If this generates too much bikeshed, I'll drop methods from the proposal. > > Regards, > Nikita >
Hi Nikita, I really like the RFC itself and got only one question regarding the class name which I couldn't find an answer in RFC. Why PHP prefix in PhpToken class name? Why can't we go with Token class name alone without the prefix? The only one which includes PHP in class names so far are only: * __PHP_Incomplete_Class * php_user_filter Above taken from https://www.php.net/manual/en/reserved.classes.php BR, Michał Brzuchalski