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 {}
-----
2015-04-18 21:20:45 +02:00
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:13 to 1:18
-----
<?php class A extends self {}
-----
2015-04-18 21:20:45 +02:00
Cannot use 'self' as class name as it is reserved from 1:23 to 1:26
-----
<?php class A extends PARENT {}
-----
Cannot use 'PARENT' as class name as it is reserved from 1:23 to 1:28
-----
<?php class A extends static {}
-----
2015-04-18 21:20:45 +02:00
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:23 to 1:28
-----
<?php class A implements self {}
-----
2015-04-18 21:20:45 +02:00
Cannot use 'self' as interface name as it is reserved from 1:26 to 1:29
-----
<?php class A implements PARENT {}
-----
Cannot use 'PARENT' as interface name as it is reserved from 1:26 to 1:31
-----
<?php class A implements static {}
-----
2015-04-18 21:20:45 +02:00
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:26 to 1:31
-----
<?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 {}
-----
2015-04-18 21:20:45 +02:00
Syntax error, unexpected T_STATIC, expecting T_STRING from 1:17 to 1:22
-----
<?php interface A extends self {}
-----
2015-04-18 21:20:45 +02:00
Cannot use 'self' as interface name as it is reserved from 1:27 to 1:30
-----
<?php interface A extends PARENT {}
-----
Cannot use 'PARENT' as interface name as it is reserved from 1:27 to 1:32
-----
<?php interface A extends static {}
-----
2015-04-18 21:20:45 +02:00
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:27 to 1:32