Skip to content

Instantly share code, notes, and snippets.

@nikita2206
Created February 19, 2013 17:40
Show Gist options
  • Select an option

  • Save nikita2206/4988075 to your computer and use it in GitHub Desktop.

Select an option

Save nikita2206/4988075 to your computer and use it in GitHub Desktop.

Revisions

  1. nikita2206 created this gist Feb 19, 2013.
    25 changes: 25 additions & 0 deletions gistfile1.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
    index ccbc9b1..75b2431 100644
    --- a/Zend/zend_language_parser.y
    +++ b/Zend/zend_language_parser.y
    @@ -588,7 +588,7 @@ class_statement:
    variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } class_variable_declaration ';'
    | class_constant_declaration ';'
    | trait_use_statement
    - | method_modifiers function is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$4, 1, $3.op_type, &$1 TSRMLS_CC); }
    + | method_modifiers method_definition is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$4, 1, $3.op_type, &$1 TSRMLS_CC); }
    '(' parameter_list ')'
    method_body { zend_do_abstract_method(&$4, &$1, &$9 TSRMLS_CC); zend_do_end_function_declaration(&$2 TSRMLS_CC); }
    ;
    @@ -835,6 +835,11 @@ function:
    T_FUNCTION { $$.u.op.opline_num = CG(zend_lineno); }
    ;

    +method_definition:
    + T_FUNCTION { $$.u.op.opline_num = CG(zend_lineno); }
    + | /* method definition without function keyword */ { $$.u.op.opline_num = CG(zend_lineno); }
    +;
    +
    lexical_vars:
    /* empty */
    | T_USE '(' lexical_var_list ')'