Closed
Description
https://wiki.php.net/rfc/namespaced_names_as_token passed on July 31st. It makes the following changes to tokenization:
Foo\Bar;
// Before: T_STRING T_NS_SEPARATOR T_STRING
// After: T_NAME_QUALIFIED
// Rule: {LABEL}("\\"{LABEL})+
\Foo;
// Before: T_NS_SEPARATOR T_STRING
// After: T_NAME_FULLY_QUALIFIED
// Rule: ("\\"{LABEL})+
namespace\Foo;
// Before: T_NAMESPACE T_NS_SEPARATOR T_STRING
// After: T_NAME_RELATIVE
// Rule: "namespace"("\\"{LABEL})+
I think the simplest way to support existing applications might be to manually split up the T_NAME_*
tokens into T_STRING, T_NAMESPACE, T_NS_SEPARATOR, etc after the call to token_get_all()
- Other new syntax like
T_MATCH
orT_FN
can have the same thing done to emulate that. Switches are fast in newer php versions when all arguments are definitely integers.
Metadata
Metadata
Assignees
Labels
No labels