Re: Re: [RFC] Normalize token_get_all() output (with flag)

From: Date: Tue, 12 Jan 2016 23:26:26 +0000
Subject: Re: Re: [RFC] Normalize token_get_all() output (with flag)
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-90581@lists.php.net to get a copy of this message
Hi! > Nice! I'll say one thing though: If we're going to introduce a class, > I'm tempted to leave token_get_all alone (or at least limit its > changes to what's in the current porposal), and have the PhpToken > class implement its own static method to do the same thing. This I like this idea better. It is also conceptually simpler - you just have one class to deal with. > 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. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#90581) next »