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