On Tue, Jan 12, 2016 at 3:26 PM, Stanislav Malyshev <smalys...@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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php