1--TEST--
2Tokenization of namespaced names
3--EXTENSIONS--
4tokenizer
5--FILE--
6<?php
7
8$code = <<<'CODE'
9<?php
10Foo
11Foo\Bar
12\Foo\Bar
13namespace\Foo
14Foo \ Bar
15CODE;
16
17foreach (PhpToken::tokenize($code) as $token) {
18    echo "{$token->getTokenName()}: \"$token->text\"\n";
19}
20
21?>
22--EXPECT--
23T_OPEN_TAG: "<?php
24"
25T_STRING: "Foo"
26T_WHITESPACE: "
27"
28T_NAME_QUALIFIED: "Foo\Bar"
29T_WHITESPACE: "
30"
31T_NAME_FULLY_QUALIFIED: "\Foo\Bar"
32T_WHITESPACE: "
33"
34T_NAME_RELATIVE: "namespace\Foo"
35T_WHITESPACE: "
36"
37T_STRING: "Foo"
38T_WHITESPACE: " "
39T_NS_SEPARATOR: "\"
40T_WHITESPACE: " "
41T_STRING: "Bar"
42