On Jan 17, 2016 05:23, "Sara Golemon" <poll...@php.net> 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 of the codeflow layout a bit (and add support for scanning > files in the process), but that's it.
I really like this, funny really that it took until now for someone to get enough of the old interface :) But rather than overloading the existing token_get_all() function with flags that change its behavior, what about just adding a new function, say token_get_all_assoc(), and give it a TOKEN_LINENUMS flag if you want to make line numbers optional for performance? At least in my experience, code becomes more readable with new method/function names than with a bunch of optional flags in cases like this. - Stig