return Ts[opline->op2.u.var].EA.class_entry->static_members;
break;
case ZEND_FETCH_FROM_THIS:
- if (!EG(this)) {
+ if (!EG(This)) {
zend_error(E_ERROR, "Using $this when not in object context");
}
/* HACK!! 'this' should be always zend_object */
- return Z_OBJPROP_P(EG(this));
+ return Z_OBJPROP_P(EG(This));
break;
case ZEND_FETCH_THIS:
{
- if (!EG(this)) {
+ if (!EG(This)) {
zend_error(E_ERROR, "Using $this when not in object context");
}
/* FIXME: Put this error back.
// zend_error(E_ERROR, "Can't overwrite $this");
//}
*/
- Ts[opline->result.u.var].var.ptr_ptr = &EG(this);
- SELECTIVE_PZVAL_LOCK(EG(this), &opline->result);
+ Ts[opline->result.u.var].var.ptr_ptr = &EG(This);
+ SELECTIVE_PZVAL_LOCK(EG(This), &opline->result);
AI_USE_PTR(Ts[opline->result.u.var].var);
return NULL;
break;
object_info object;
temp_variable *Ts;
zend_bool original_in_execution;
- zend_class_entry *calling_namespace;
+ zend_class_entry *calling_scope;
} zend_execute_data;
#define EX(element) execute_data.element
int class_name_strlen;
if (EX(opline)->extended_value == ZEND_FETCH_CLASS_SELF) {
- if (!EG(namespace)) {
+ if (!EG(scope)) {
zend_error(E_ERROR, "Cannot fetch self:: when no class scope is active");
}
- EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(namespace);
+ EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(scope);
NEXT_OPCODE();
} else if (EX(opline)->extended_value == ZEND_FETCH_CLASS_MAIN) {
EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(main_class_ptr);
NEXT_OPCODE();
} else if (EX(opline)->extended_value == ZEND_FETCH_CLASS_PARENT) {
- if (!EG(namespace)) {
+ if (!EG(scope)) {
zend_error(E_ERROR, "Cannot fetch parent:: when no class scope is active");
}
- if (!EG(namespace)->parent) {
+ if (!EG(scope)->parent) {
zend_error(E_ERROR, "Cannot fetch parent:: as current class scope has no parent");
}
- EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(namespace)->parent;
+ EX(Ts)[EX(opline)->result.u.var].EA.class_entry = EG(scope)->parent;
NEXT_OPCODE();
}
EX(fbc) = EX(fbc_constructor);
if(EX(fbc)->type == ZEND_USER_FUNCTION) { /* HACK!! */
- EX(calling_namespace) = Z_OBJCE_P(EX(object).ptr);
+ EX(calling_scope) = Z_OBJCE_P(EX(object).ptr);
} else {
- EX(calling_namespace) = NULL;
+ EX(calling_scope) = NULL;
}
NEXT_OPCODE();
function_name_strlen = tmp.value.str.len;
}
- EX(calling_namespace) = EG(namespace);
+ EX(calling_scope) = EG(scope);
if (EX(opline)->extended_value == ZEND_FETCH_FROM_THIS) {
- if (!EG(this)) {
+ if (!EG(This)) {
zend_error(E_ERROR, "Can't fetch $this as not in object context");
}
- EX(object).ptr = EG(this);
+ EX(object).ptr = EG(This);
} else {
EX(object).ptr = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
}
}
if(EX(fbc)->type == ZEND_USER_FUNCTION) {
- EX(calling_namespace) = Z_OBJCE_P(EX(object).ptr);
+ EX(calling_scope) = Z_OBJCE_P(EX(object).ptr);
} else {
- EX(calling_namespace) = NULL;
+ EX(calling_scope) = NULL;
}
if (!is_const) {
function_name_strlen = tmp.value.str.len;
}
- EX(calling_namespace) = EG(namespace);
+ EX(calling_scope) = EG(scope);
- if ((EX(object).ptr = EG(this))) {
+ if ((EX(object).ptr = EG(This))) {
EX(object).ptr->refcount++;
}
ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry;
- EX(calling_namespace) = ce;
+ EX(calling_scope) = ce;
if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &function)==FAILURE) {
zend_error(E_ERROR, "Call to undefined function: %s()", function_name_strval);
function_name_strlen = tmp.value.str.len;
}
- EX(calling_namespace) = EG(namespace);
+ EX(calling_scope) = EG(scope);
do {
- if (EG(namespace)) {
- if (zend_hash_find(&EG(namespace)->function_table, function_name_strval, function_name_strlen+1, (void **) &function) == SUCCESS) {
- if ((EX(object).ptr = EG(this))) {
+ if (EG(scope)) {
+ if (zend_hash_find(&EG(scope)->function_table, function_name_strval, function_name_strlen+1, (void **) &function) == SUCCESS) {
+ if ((EX(object).ptr = EG(This))) {
EX(object).ptr->refcount++;
}
break;
if (zend_hash_find(EG(function_table), function_name_strval, function_name_strlen+1, (void **) &function)==FAILURE) {
zend_error(E_ERROR, "Call to undefined function: %s()", function_name_strval);
}
- EX(calling_namespace) = NULL;
+ EX(calling_scope) = NULL;
EX(object).ptr = NULL;
} while (0);
zend_ptr_stack_push(&EG(arg_types_stack), EX(object).ptr);
do {
- if (EG(namespace)) {
- if (zend_hash_find(&EG(namespace)->function_table, fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function) == SUCCESS) {
- if ((EX(object).ptr = EG(this))) {
+ if (EG(scope)) {
+ if (zend_hash_find(&EG(scope)->function_table, fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function) == SUCCESS) {
+ if ((EX(object).ptr = EG(This))) {
EX(object).ptr->refcount++;
}
break;
EX(object).ptr = NULL;
} while (0);
- EX(calling_namespace) = EG(namespace);
+ EX(calling_scope) = EG(scope);
FREE_OP(EX(Ts), &EX(opline)->op1, EG(free_op1));
goto do_fcall_common;
do_fcall_common:
{
zval **original_return_value;
- zend_class_entry *current_namespace;
+ zend_class_entry *current_scope;
zval *current_this;
int return_value_used = RETURN_VALUE_USED(EX(opline));
zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) EX(opline)->extended_value, NULL);
- current_namespace = EG(namespace);
- EG(namespace) = EX(calling_namespace);
+ current_scope = EG(scope);
+ EG(scope) = EX(calling_scope);
- current_this = EG(this);
- EG(this) = EX(object).ptr;
+ current_this = EG(This);
+ EG(This) = EX(object).ptr;
EX(Ts)[EX(opline)->result.u.var].var.ptr_ptr = &EX(Ts)[EX(opline)->result.u.var].var.ptr;
EG(function_state_ptr) = &EX(function_state);
zend_ptr_stack_clear_multiple(TSRMLS_C);
- EG(namespace) = current_namespace;
+ EG(scope) = current_scope;
- if (EG(this)) {
- zval_ptr_dtor(&EG(this));
+ if (EG(This)) {
+ zval_ptr_dtor(&EG(This));
}
- EG(this) = current_this;
+ EG(This) = current_this;
if (EG(exception)) {
if (EX(opline)->op2.u.opline_num == -1) {
EG(exception) = NULL;
NEXT_OPCODE();
}
- case ZEND_NAMESPACE:
- {
-#if 0
- if (EX(opline)->op1.op_type == IS_UNUSED) {
- EG(namespace) = NULL;
- } else {
- EG(namespace) = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry;
- }
-#endif
- NEXT_OPCODE();
- }
case ZEND_SEND_VAL:
if (EX(opline)->extended_value==ZEND_DO_FCALL_BY_NAME
&& ARG_SHOULD_BE_SENT_BY_REF(EX(opline)->op2.u.opline_num, EX(fbc), EX(fbc)->common.arg_types)) {
zval **value;
if (EX(opline)->op1.op_type == IS_UNUSED) {
- if (EG(namespace)) {
- ce = EG(namespace);
+ if (EG(scope)) {
+ ce = EG(scope);
if (zend_hash_find(&ce->constants_table, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) {
zval_update_constant(value, (void *) 1 TSRMLS_CC);
EX(Ts)[EX(opline)->result.u.var].tmp_var = **value;
EG(exception) = NULL;
- EG(namespace) = NULL;
+ EG(scope) = NULL;
EG(main_class_ptr) = &CG(main_class);
CG(main_class).static_members = &EG(symbol_table);
- EG(this) = NULL;
+ EG(This) = NULL;
}
int (*orig_unary_op)(zval *result, zval *op1);
int (*orig_binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
zval function_name_copy;
- zend_class_entry *current_namespace;
- zend_class_entry *calling_namespace = NULL;
+ zend_class_entry *current_scope;
+ zend_class_entry *calling_scope = NULL;
zval *current_this;
*retval_ptr_ptr = NULL;
if (Z_TYPE_PP(object_pp) == IS_OBJECT) {
function_table = &Z_OBJCE_PP(object_pp)->function_table;
- calling_namespace = Z_OBJCE_PP(object_pp);
+ calling_scope = Z_OBJCE_PP(object_pp);
} else if (Z_TYPE_PP(object_pp) == IS_STRING) {
zend_class_entry *ce;
char *lc_class;
return FAILURE;
function_table = &ce->function_table;
- calling_namespace = ce;
+ calling_scope = ce;
object_pp = NULL;
} else
return FAILURE;
EG(function_state_ptr) = &function_state;
- current_namespace = EG(namespace);
- EG(namespace) = calling_namespace;
+ current_scope = EG(scope);
+ EG(scope) = calling_scope;
- current_this = EG(this);
+ current_this = EG(This);
if (object_pp) {
- EG(this) = *object_pp;
+ EG(This) = *object_pp;
- if (!PZVAL_IS_REF(EG(this))) {
- EG(this)->refcount++; /* For $this pointer */
+ if (!PZVAL_IS_REF(EG(This))) {
+ EG(This)->refcount++; /* For $this pointer */
} else {
zval *this_ptr;
ALLOC_ZVAL(this_ptr);
- *this_ptr = *EG(this);
+ *this_ptr = *EG(This);
INIT_PZVAL(this_ptr);
zval_copy_ctor(this_ptr);
- EG(this) = this_ptr;
+ EG(This) = this_ptr;
}
} else {
- EG(this) = NULL;
+ EG(This) = NULL;
}
zend_ptr_stack_clear_multiple(TSRMLS_C);
EG(function_state_ptr) = original_function_state_ptr;
- if (EG(this)) {
- zval_ptr_dtor(&EG(this));
+ if (EG(This)) {
+ zval_ptr_dtor(&EG(This));
}
- EG(namespace) = current_namespace;
- EG(this) = current_this;
+ EG(scope) = current_scope;
+ EG(This) = current_this;
return SUCCESS;
}