Re: Re: [RFC] Normalize token_get_all() output (with flag)
| From: | Sara Golemon | Date: | Wed, 13 Jan 2016 00:54:28 +0000 |
| Subject: | Re: Re: [RFC] Normalize token_get_all() output (with flag) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-90585@lists.php.net to get a copy of this message | ||
On Tue, Jan 12, 2016 at 3:26 PM, Stanislav Malyshev <smalyshev@gmail.com> wrote:
>> How does this sound?
>> 1. Keep the current RFC basically as is. It's a minor addition to
>> token_get_all() which can be slotted into existing code to improve
>> readability, but offers little advantage beyond that.
>> 2. Make a new extension to prototype this PhpToken class outside of
>> the php-src tree, add all the extra goodies we want (array of token
>> return, iterator of token return, extra info, limited info, etc...)
>> 3. When this extension is good and solid, propose merging into core.
>
> Sounds great! I wonder if it'd be possible to make a real streaming
> iterator? That would be so nice.
>
I can't imagine why not. The scanner lends itself perfectly to the
Iterator model and would end up making a much bigger dent in the
memory consumption than dithering between arrays and classes (though
"why not both" applies here). :)
Bouncing between several tasks atm, but I'll try to get something
started and invite some folks to the repo.
-Sara