php-parser/test/code/parser/stmt/namespace/invalidName.test
Nikita Popov 0cee2088ea Remove self/parent/static restriction for namespace names
This no longer applies as of PHP 8.0.
2020-08-09 21:21:22 +02:00

51 lines
1.1 KiB
Plaintext

Invalid namespace names
-----
<?php use A as self;
-----
Cannot use A as self because 'self' is a special class name from 1:16 to 1:19
array(
0: Stmt_Use(
type: TYPE_NORMAL (1)
uses: array(
0: Stmt_UseUse(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
)
)
alias: Identifier(
name: self
)
)
)
)
)
-----
<?php use B as PARENT;
-----
Cannot use B as PARENT because 'PARENT' is a special class name from 1:16 to 1:21
array(
0: Stmt_Use(
type: TYPE_NORMAL (1)
uses: array(
0: Stmt_UseUse(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: B
)
)
alias: Identifier(
name: PARENT
)
)
)
)
)
-----
<?php use C as static;
-----
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:16 to 1:21
array(
)