Re: token_get_all() new API
| From: | Nikita Popov | Date: | Mon, 10 Feb 2014 15:29:09 +0000 |
| Subject: | Re: token_get_all() new API | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72441@lists.php.net to get a copy of this message | ||
On Mon, Feb 10, 2014 at 3:54 PM, Julien Pauli <jpauli@php.net> wrote:
> Hi all,
>
> I recently worked on token_get_all() implementation to add an extra
> argument to the function to show token names directly in the output
> instead of having to call token_name() on every output (usually what
> is done nowadays).
>
> I also added a flag so that the parsed scanner value can become
> optionnal in the output, as sometimes one just wants a token stream
> and is not interested in dealing with the scanner ouput.
>
> If you have ideas or thoughts ?
>
> https://github.com/jpauli/php-src/compare/token_names
>
> Julien.P
>
Do you have some examples for practical uses of these modes? E.g. in what
situation would you need only the token names, but not their content?
What I don't like about this change is that it introduces an additional
llist indirection, which presumably will have the function slower and more
memory heavy.
Nikita