Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
- index 5296128..572a0e9 100644
- --- a/Zend/zend_compile.c
- +++ b/Zend/zend_compile.c
- @@ -4979,18 +4979,44 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, cons
- error = 1;
- }
- - if (CG(current_namespace)) {
- - /* Prefix class name with name of current namespace */
- - znode tmp;
- -
- - tmp.op_type = IS_CONST;
- - tmp.u.constant = *CG(current_namespace);
- - zval_copy_ctor(&tmp.u.constant);
- - zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
- - *class_name = tmp;
- - efree(lcname);
- - lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
- - }
- + if (CG(active_class_entry)) {
- + /* prefix class name with the name of current class */
- + znode ns;
- + znode active;
- +
- + if (CG(current_namespace)) {
- + ns.op_type = IS_CONST;
- + ns.u.constant = *CG(current_namespace);
- + zval_copy_ctor(&ns.u.constant);
- + } else {
- + ns.op_type = IS_CONST;
- + ZVAL_STRINGL(
- + &ns.u.constant,
- + CG(active_class_entry)->name, CG(active_class_entry)->name_length, 1);
- + }
- +
- + zend_do_build_namespace_name(
- + &ns, &ns, class_name TSRMLS_CC);
- + *class_name = ns;
- +
- + efree(lcname);
- + lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
- +
- + } else {
- + if (CG(current_namespace)) {
- + /* Prefix class name with name of current namespace */
- + znode tmp;
- +
- + tmp.op_type = IS_CONST;
- + tmp.u.constant = *CG(current_namespace);
- + zval_copy_ctor(&tmp.u.constant);
- + zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
- + *class_name = tmp;
- + efree(lcname);
- + lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
- + php_printf("%s\n", lcname);
- + }
- + }
- if (error) {
- char *tmp = zend_str_tolower_dup(Z_STRVAL_PP(ns_name), Z_STRLEN_PP(ns_name));
- diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
- index 3a94955..424f5f7 100644
- --- a/Zend/zend_language_parser.y
- +++ b/Zend/zend_language_parser.y
- @@ -589,6 +589,7 @@ class_statement_list:
- class_statement:
- variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } class_variable_declaration ';'
- | class_constant_declaration ';'
- + | unticked_class_declaration_statement
- | trait_use_statement
- | method_modifiers function is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$4, 1, $3.op_type, &$1 TSRMLS_CC); }
- '(' parameter_list ')'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement