php-parser/test/code/parser/stmt/class/name.test-fail

62 lines
1.7 KiB
Plaintext
Raw Normal View History

Invalid class name
-----
<?php class self {}
-----
Cannot use 'self' as class name as it is reserved on line 1
-----
<?php class parent {}
-----
Cannot use 'parent' as class name as it is reserved on line 1
-----
<?php class static {}
-----
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:12 to 1:17
-----
<?php class A extends self {}
-----
Cannot use 'self' as class name as it is reserved from 1:22 to 1:25
-----
<?php class A extends parent {}
-----
Cannot use 'parent' as class name as it is reserved from 1:22 to 1:27
-----
<?php class A extends static {}
-----
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:22 to 1:27
-----
<?php class A implements self {}
-----
Cannot use 'self' as interface name as it is reserved from 1:25 to 1:28
-----
<?php class A implements parent {}
-----
Cannot use 'parent' as interface name as it is reserved from 1:25 to 1:30
-----
<?php class A implements static {}
-----
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:25 to 1:30
-----
<?php interface self {}
-----
Cannot use 'self' as class name as it is reserved on line 1
-----
<?php interface parent {}
-----
Cannot use 'parent' as class name as it is reserved on line 1
-----
<?php interface static {}
-----
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:16 to 1:21
-----
<?php interface A extends self {}
-----
Cannot use 'self' as interface name as it is reserved from 1:26 to 1:29
-----
<?php interface A extends parent {}
-----
Cannot use 'parent' as interface name as it is reserved from 1:26 to 1:31
-----
<?php interface A extends static {}
-----
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:26 to 1:31