- Infrastructure for implementing imports of methods.
internal_function->handler = ptr->handler;
internal_function->arg_types = ptr->func_arg_types;
internal_function->function_name = ptr->fname;
+ internal_function->scope = NULL;
if (!internal_function->handler) {
zend_error(error_type, "Null function defined as active function");
zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
op_array.arg_types = NULL;
op_array.return_reference = return_reference;
+ op_array.scope = CG(active_class_entry);
+
if (is_method) {
zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
if ((CG(active_class_entry)->name_length == (uint) name_len) && (!memcmp(CG(active_class_entry)->name, name, name_len))) {
struct _zend_op_array {
- zend_uchar type; /* MUST be the first element of this struct! */
+ zend_uchar type; /* MUST be the first element of this struct! */
zend_uchar *arg_types; /* MUST be the second element of this struct! */
- char *function_name; /* MUST be the third element of this struct! */
+ char *function_name; /* MUST be the third element of this struct! */
+ zend_class_entry *scope; /* MUST be the fourth element of this struct! */
zend_uint *refcount;
typedef struct _zend_internal_function {
- zend_uchar type; /* MUST be the first element of this struct! */
+ zend_uchar type; /* MUST be the first element of this struct! */
- zend_uchar *arg_types; /* MUST be the second element of this struct */
- char *function_name; /* MUST be the third element of this struct */
+ zend_uchar *arg_types; /* MUST be the second element of this struct! */
+ char *function_name; /* MUST be the third element of this struct! */
+ zend_class_entry *scope; /* MUST be the fourth element of this struct! */
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
} zend_internal_function;
typedef struct _zend_overloaded_function {
- zend_uchar type; /* MUST be the first element of this struct! */
+ zend_uchar type; /* MUST be the first element of this struct! */
- zend_uchar *arg_types; /* MUST be the second element of this struct */
- char *function_name; /* MUST be the third element of this struct */
+ zend_uchar *arg_types; /* MUST be the second element of this struct! */
+ char *function_name; /* MUST be the third element of this struct! */
+ zend_class_entry *scope; /* MUST be the fourth element of this struct! */
zend_uint var;
} zend_overloaded_function;
typedef union _zend_function {
zend_uchar type; /* MUST be the first element of this struct! */
+
struct {
zend_uchar type; /* never used */
zend_uchar *arg_types;
char *function_name;
+ zend_class_entry *scope;
} common;
zend_op_array op_array;
| T_DECLARE { zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(TSRMLS_C); }
| ';' /* empty statement */
| T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}'
- catches
+ T_CATCH '(' catch_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$1, &$8, &$9, 1 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
+ additional_catches
| T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); }
| T_DELETE cvar ';' { zend_do_end_variable_parse(BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1, ZEND_UNSET_OBJ TSRMLS_CC); }
;
-catches:
- catches T_CATCH '(' catch_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$2, &$4, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$2 TSRMLS_CC); }
- | T_CATCH '(' catch_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$4, 1 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
+additional_catches:
+ non_empty_additional_catches
+ | /* empty */
+;
+
+non_empty_additional_catches:
+ non_empty_additional_catches T_CATCH '(' catch_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$2, &$4, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$2 TSRMLS_CC); }
+ | T_CATCH '(' catch_class_entry T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$4, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
;
op_array->arg_types = NULL;
+ op_array->scope = NULL;
+
op_array->brk_cont_array = NULL;
op_array->last_brk_cont = 0;
op_array->current_brk_cont = -1;