What are practical and day-to-day usage examples of PHP Tokenizer ?
Has anyone used this?
I personally have already used it to build a PHP sandbox, which tries to create a more secure environment for executing PHP scripts.
Furthermore I did loads of experiments to preprocess PHP, e.g. I have an (incomplete) PHP 5.3 emulator for PHP 5.2 called prephp.
And many other similar tools, like source code analyzers (for security auditing, code style analysis, ...) use the Tokenizer as well.
But even for smaller things the Tokenizer may be handy. Not just large scale code analyzers. For example if you are accepting a PHP array and want to check that it's not malicious, you can do so using the Tokenizer.
PS: Currently I am switching to actually parsing the PHP, instead of just tokenizing it, using a PHP parser written in PHP I recently published (it works, but isn't really practically usable yet).