*result = last_op->result;
return;
} else {
- if (opline_is_fetch_this(last_op TSRMLS_CC)) {
+ if (variable->op_type == IS_VAR &&
+ opline_is_fetch_this(last_op TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
}
}
if (last_op_number > 0) {
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
- if (opline_is_fetch_this(last_op TSRMLS_CC)) {
+ if (lvar->op_type == IS_VAR &&
+ opline_is_fetch_this(last_op TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
}
}