mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
nuke "main" as a reserved keyword
This commit is contained in:
parent
288dacca0c
commit
778d8c8bf1
@ -2251,8 +2251,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
|
||||
|
||||
zend_str_tolower(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
|
||||
|
||||
if (!(strcmp(class_name->u.constant.value.str.val, "main") && strcmp(class_name->u.constant.value.str.val, "self") &&
|
||||
strcmp(class_name->u.constant.value.str.val, "parent"))) {
|
||||
if (!(strcmp(class_name->u.constant.value.str.val, "self") && strcmp(class_name->u.constant.value.str.val, "parent"))) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", class_name->u.constant.value.str.val);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user