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

2020-02-25 Thread Michał Brzuchalski
czw., 13 lut 2020 o 10:48 Nikita Popov 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

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

2020-02-15 Thread Nikita Popov
On Fri, Feb 14, 2020 at 7:30 PM Rowan Tommins wrote: > On Fri, 14 Feb 2020 at 16:33, Nikita Popov wrote: > > > This constructor will initialize the corresponding properties. Now, the > > behavior that would make most sense to me (if extension of the class is > > allowed) is that

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

2020-02-14 Thread Rowan Tommins
On Fri, 14 Feb 2020 at 16:33, Nikita Popov wrote: > This constructor will initialize the corresponding properties. Now, the > behavior that would make most sense to me (if extension of the class is > allowed) is that MyPhpToken::getAll() is going to create the new tokens > based on "new

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

2020-02-14 Thread Nikita Popov
On Fri, Feb 14, 2020 at 2:38 PM Sara Golemon wrote: > On Thu, Feb 13, 2020 at 3:48 AM Nikita Popov wrote: > >> 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

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

2020-02-14 Thread Nikita Popov
On Fri, Feb 14, 2020 at 2:44 PM Marco Pivetta wrote: > On Fri, Feb 14, 2020 at 2:38 PM Sara Golemon wrote: > >> Thanks for picking it up, and I agree with your response to Larry. As >> nice >> as it would be to lazy iterate, the scanner is just in NO shape to >> tolerate >> reentering

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

2020-02-14 Thread Sara Golemon
On Fri, Feb 14, 2020 at 7:44 AM Marco Pivetta wrote: > On Fri, Feb 14, 2020 at 2:38 PM Sara Golemon wrote: > >> Thanks for picking it up, and I agree with your response to Larry. As >> nice >> as it would be to lazy iterate, the scanner is just in NO shape to >> tolerate >> reentering

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

2020-02-14 Thread Marco Pivetta
On Fri, Feb 14, 2020 at 2:38 PM Sara Golemon wrote: > Thanks for picking it up, and I agree with your response to Larry. As nice > as it would be to lazy iterate, the scanner is just in NO shape to tolerate > reentering userspace and potentially reinvoking the scanner before the > first run

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

2020-02-14 Thread Sara Golemon
On Thu, Feb 13, 2020 at 3:48 AM Nikita Popov wrote: > 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,

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

2020-02-14 Thread Thomas Hruska
On 2/14/2020 1:48 AM, Nikita Popov wrote: On Thu, Feb 13, 2020 at 6:06 PM Larry Garfield wrote: On Thu, Feb 13, 2020, at 3:47 AM, Nikita Popov wrote: 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

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

2020-02-14 Thread Nikita Popov
On Fri, Feb 14, 2020 at 9:48 AM Nikita Popov wrote: > On Thu, Feb 13, 2020 at 6:06 PM Larry Garfield > wrote: > >> On Thu, Feb 13, 2020, at 3:47 AM, Nikita Popov wrote: >> > Hi internals, >> > >> > This has been discussed a while ago already, now as a proper proposal: >> >

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

2020-02-14 Thread Nikita Popov
On Thu, Feb 13, 2020 at 6:06 PM Larry Garfield wrote: > On Thu, Feb 13, 2020, at 3:47 AM, Nikita Popov wrote: > > 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

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

2020-02-13 Thread Levi Morrison via internals
On Thu, Feb 13, 2020 at 2:48 AM Nikita Popov wrote: > > 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

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

2020-02-13 Thread Larry Garfield
On Thu, Feb 13, 2020, at 3:47 AM, Nikita Popov wrote: > 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