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

2016-01-19 Thread Stig Bakken
On Mon, Jan 18, 2016 at 2:41 AM, Sara Golemon wrote: > On Sun, Jan 17, 2016 at 3:34 AM, Stig Bakken > wrote: > > On Jan 17, 2016 05:23, "Sara Golemon" wrote: > >> > >> Okay, i've got a starting point up at > >> https://github.com/phplang/php-token . It's basically just > >> token_get_all() and

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

2016-01-17 Thread Sara Golemon
On Sun, Jan 17, 2016 at 3:34 AM, Stig Bakken wrote: > On Jan 17, 2016 05:23, "Sara Golemon" wrote: >> >> Okay, i've got a starting point up at >> https://github.com/phplang/php-token . It's basically just >> token_get_all() and token_name() as they currently stand (I didn't >> even bother overri

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

2016-01-17 Thread Stig Bakken
On Jan 17, 2016 05:23, "Sara Golemon" wrote: > > Okay, i've got a starting point up at > https://github.com/phplang/php-token . It's basically just > token_get_all() and token_name() as they currently stand (I didn't > even bother overriding the behavior in token_name() yet). I did > change some

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

2016-01-16 Thread Sara Golemon
On Thu, Jan 14, 2016 at 7:59 PM, Andrea Faulds wrote: >> 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 go

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

2016-01-14 Thread Andrea Faulds
Hi Sara, Sara Golemon 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 o

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

2016-01-12 Thread Sara Golemon
On Tue, Jan 12, 2016 at 3:26 PM, Stanislav Malyshev 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 e

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

2016-01-12 Thread Stanislav Malyshev
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 be

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

2016-01-12 Thread Sara Golemon
On Tue, Jan 12, 2016 at 9:07 AM, Rouven Weßling wrote: >> On 05 Jan 2016, at 21:52, Andrea Faulds wrote: >> This is more of a side-note, but maybe it's worth bringing up. Since >> token_get_all gives an array with subarrays of a regular structure, might it >> be worthwhile returning an array of

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

2016-01-12 Thread Rouven Weßling
> On 05 Jan 2016, at 21:52, Andrea Faulds wrote: > > This is more of a side-note, but maybe it's worth bringing up. Since > token_get_all gives an array with subarrays of a regular structure, might it > be worthwhile returning an array of objects instead? It would probably reduce > memory usa

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

2016-01-10 Thread Stanislav Malyshev
Hi! >> A suggestion from a co-worker who's worried about seeing patterns like: >> >> case ($t['token']) { >> case T_PAAMAYIM_NEKUDOTAYIM: >> // do something >>break; >> case ord(';'): >> // do something else >> break; >> } What's wrong with this pattern? Looks pretty fine to m

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

2016-01-10 Thread Sara Golemon
On Tue, Jan 5, 2016 at 11:51 AM, Sara Golemon wrote: > On Mon, Jan 4, 2016 at 2:56 PM, Sara Golemon wrote: >> https://wiki.php.net/rfc/token-get-always-tokens >> > A suggestion from a co-worker who's worried about seeing patterns like: > > case ($t['token']) { > case T_PAAMAYIM_NEKUDOTAYIM: >

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

2016-01-05 Thread Andrea Faulds
Hi Sara, Sara Golemon wrote: On Tue, Jan 5, 2016 at 12:52 PM, Andrea Faulds wrote: This is more of a side-note, but maybe it's worth bringing up. Since token_get_all gives an array with subarrays of a regular structure, might it be worthwhile returning an array of objects instead? It would pro

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

2016-01-05 Thread Sara Golemon
On Tue, Jan 5, 2016 at 12:52 PM, Andrea Faulds wrote: > This is more of a side-note, but maybe it's worth bringing up. Since > token_get_all gives an array with subarrays of a regular structure, might it > be worthwhile returning an array of objects instead? It would probably > reduce memory usage

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

2016-01-05 Thread Andrea Faulds
Hi Sara, Sara Golemon wrote: I swear, 2016 isn't going to be "An RFC per day" year, but... https://wiki.php.net/rfc/token-get-always-tokens This should be pretty non-controversial. I hope? This is more of a side-note, but maybe it's worth bringing up. Since token_get_all gives an array wit

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

2016-01-05 Thread Sara Golemon
On Mon, Jan 4, 2016 at 2:56 PM, Sara Golemon wrote: > https://wiki.php.net/rfc/token-get-always-tokens > A suggestion from a co-worker who's worried about seeing patterns like: case ($t['token']) { case T_PAAMAYIM_NEKUDOTAYIM: // do something break; case ord(';'): // do something e