comparison vendor/nikic/php-parser/test/code/parser/stmt/namespace/invalidName.test @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 5fb285c0d0e3
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 Invalid namespace names
2 -----
3 <?php namespace self;
4 -----
5 Cannot use 'self' as namespace name from 1:17 to 1:20
6 array(
7 0: Stmt_Namespace(
8 name: Name(
9 parts: array(
10 0: self
11 )
12 )
13 stmts: array(
14 )
15 )
16 )
17 -----
18 <?php namespace PARENT;
19 -----
20 Cannot use 'PARENT' as namespace name from 1:17 to 1:22
21 array(
22 0: Stmt_Namespace(
23 name: Name(
24 parts: array(
25 0: PARENT
26 )
27 )
28 stmts: array(
29 )
30 )
31 )
32 -----
33 <?php namespace static;
34 -----
35 Syntax error, unexpected T_STATIC, expecting T_STRING or T_NS_SEPARATOR or '{' from 1:17 to 1:22
36 array(
37 )
38 -----
39 <?php use A as self;
40 -----
41 Cannot use A as self because 'self' is a special class name from 1:16 to 1:19
42 array(
43 0: Stmt_Use(
44 type: TYPE_NORMAL (1)
45 uses: array(
46 0: Stmt_UseUse(
47 type: TYPE_UNKNOWN (0)
48 name: Name(
49 parts: array(
50 0: A
51 )
52 )
53 alias: self
54 )
55 )
56 )
57 )
58 -----
59 <?php use B as PARENT;
60 -----
61 Cannot use B as PARENT because 'PARENT' is a special class name from 1:16 to 1:21
62 array(
63 0: Stmt_Use(
64 type: TYPE_NORMAL (1)
65 uses: array(
66 0: Stmt_UseUse(
67 type: TYPE_UNKNOWN (0)
68 name: Name(
69 parts: array(
70 0: B
71 )
72 )
73 alias: PARENT
74 )
75 )
76 )
77 )
78 -----
79 <?php use C as static;
80 -----
81 Syntax error, unexpected T_STATIC, expecting T_STRING from 1:16 to 1:21
82 array(
83 )