Bug #61070 [Opn->Nab]: How to distinguish tokenizer T_USE for namespace and 'use' in anonymous func ?
Edit report at https://bugs.php.net/bug.php?id=61070&edit=1
ID: 61070
Updated by: nikic@php.net
Reported by: thomas dot lecarpentier+bugphp at gmail dot com
Summary: How to distinguish tokenizer T_USE for namespace and
'use' in anonymous func ?
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
This is not a PHP bug. That's pretty much what lexical tokens are good for, so they can be
reused.
You have to determine what the token means from the context. Alternatively you can use a PHP parser
which will do this for you.
Previous Comments:
------------------------------------------------------------------------
[2012-02-13 13:49:19] thomas dot lecarpentier+bugphp at gmail dot com
Description:
------------
if I have an anonymous function with 'use' keyword (describe in page : http://fr2.php.net/manual/en/functions.anonymous.php
) , but with the tokenizer (token_get_all() : http://fr2.php.net/manual/en/function.token-get-all.php
) find and T_USE token, but the rest of line is not a namespace.
How can I distinguish the 2 use cases ?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61070&edit=1
Thread (2 messages)