|
|
|
@ -3082,13 +3082,8 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A |
|
|
|
} |
|
|
|
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
if(Z_OBJ_HT_P(array_ptr)->get_class_entry == NULL) { |
|
|
|
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class"); |
|
|
|
ZEND_VM_JMP(opline->op2.jmp_addr); |
|
|
|
} |
|
|
|
|
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || ce->get_iterator == NULL) { |
|
|
|
if (ce->get_iterator == NULL) { |
|
|
|
Z_ADDREF_P(array_ptr); |
|
|
|
} |
|
|
|
array_ref = array_ptr; |
|
|
|
@ -3112,7 +3107,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A |
|
|
|
} |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || !ce->get_iterator) { |
|
|
|
if (!ce->get_iterator) { |
|
|
|
if (IS_CONST == IS_CV) { |
|
|
|
Z_ADDREF_P(array_ref); |
|
|
|
} |
|
|
|
@ -3426,16 +3421,12 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER |
|
|
|
break; |
|
|
|
case IS_OBJECT: |
|
|
|
if (Z_TYPE_P(value) == opline->extended_value) { |
|
|
|
if (Z_OBJ_HT_P(value)->get_class_entry == NULL) { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
@ -4180,8 +4171,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -5503,8 +5493,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -6698,8 +6687,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -7644,8 +7632,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -8633,8 +8620,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -9913,13 +9899,8 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG |
|
|
|
} |
|
|
|
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
if(Z_OBJ_HT_P(array_ptr)->get_class_entry == NULL) { |
|
|
|
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class"); |
|
|
|
ZEND_VM_JMP(opline->op2.jmp_addr); |
|
|
|
} |
|
|
|
|
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || ce->get_iterator == NULL) { |
|
|
|
if (ce->get_iterator == NULL) { |
|
|
|
Z_ADDREF_P(array_ptr); |
|
|
|
} |
|
|
|
array_ref = array_ptr; |
|
|
|
@ -9943,7 +9924,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG |
|
|
|
} |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || !ce->get_iterator) { |
|
|
|
if (!ce->get_iterator) { |
|
|
|
if (IS_TMP_VAR == IS_CV) { |
|
|
|
Z_ADDREF_P(array_ref); |
|
|
|
} |
|
|
|
@ -10222,7 +10203,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A |
|
|
|
SAVE_OPLINE(); |
|
|
|
expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); |
|
|
|
|
|
|
|
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { |
|
|
|
if (Z_TYPE_P(expr) == IS_OBJECT) { |
|
|
|
result = instanceof_function(Z_OBJCE_P(expr), Z_CE_P(EX_VAR(opline->op2.var)) TSRMLS_CC); |
|
|
|
} else { |
|
|
|
result = 0; |
|
|
|
@ -10294,16 +10275,12 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A |
|
|
|
break; |
|
|
|
case IS_OBJECT: |
|
|
|
if (Z_TYPE_P(value) == opline->extended_value) { |
|
|
|
if (Z_OBJ_HT_P(value)->get_class_entry == NULL) { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
@ -16644,13 +16621,8 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG |
|
|
|
} |
|
|
|
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
if(Z_OBJ_HT_P(array_ptr)->get_class_entry == NULL) { |
|
|
|
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class"); |
|
|
|
ZEND_VM_JMP(opline->op2.jmp_addr); |
|
|
|
} |
|
|
|
|
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || ce->get_iterator == NULL) { |
|
|
|
if (ce->get_iterator == NULL) { |
|
|
|
Z_ADDREF_P(array_ptr); |
|
|
|
} |
|
|
|
array_ref = array_ptr; |
|
|
|
@ -16674,7 +16646,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG |
|
|
|
} |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || !ce->get_iterator) { |
|
|
|
if (!ce->get_iterator) { |
|
|
|
if (IS_VAR == IS_CV) { |
|
|
|
Z_ADDREF_P(array_ref); |
|
|
|
} |
|
|
|
@ -17181,7 +17153,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A |
|
|
|
SAVE_OPLINE(); |
|
|
|
expr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); |
|
|
|
|
|
|
|
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { |
|
|
|
if (Z_TYPE_P(expr) == IS_OBJECT) { |
|
|
|
result = instanceof_function(Z_OBJCE_P(expr), Z_CE_P(EX_VAR(opline->op2.var)) TSRMLS_CC); |
|
|
|
} else { |
|
|
|
result = 0; |
|
|
|
@ -17253,16 +17225,12 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A |
|
|
|
break; |
|
|
|
case IS_OBJECT: |
|
|
|
if (Z_TYPE_P(value) == opline->extended_value) { |
|
|
|
if (Z_OBJ_HT_P(value)->get_class_entry == NULL) { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
@ -18883,8 +18851,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -21142,8 +21109,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -23369,8 +23335,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -24844,8 +24809,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -26788,8 +26752,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ |
|
|
|
GC_REFCOUNT(object)++; |
|
|
|
} |
|
|
|
if (!object || |
|
|
|
(object->handlers->get_class_entry && |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC))) { |
|
|
|
!instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { |
|
|
|
/* We are calling method of the other (incompatible) class, |
|
|
|
but passing $this. This is done for compatibility with php-4. */ |
|
|
|
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { |
|
|
|
@ -34294,13 +34257,8 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS |
|
|
|
} |
|
|
|
if (Z_REFCOUNTED_P(array_ref)) Z_ADDREF_P(array_ref); |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
if(Z_OBJ_HT_P(array_ptr)->get_class_entry == NULL) { |
|
|
|
zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class"); |
|
|
|
ZEND_VM_JMP(opline->op2.jmp_addr); |
|
|
|
} |
|
|
|
|
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || ce->get_iterator == NULL) { |
|
|
|
if (ce->get_iterator == NULL) { |
|
|
|
Z_ADDREF_P(array_ptr); |
|
|
|
} |
|
|
|
array_ref = array_ptr; |
|
|
|
@ -34324,7 +34282,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS |
|
|
|
} |
|
|
|
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { |
|
|
|
ce = Z_OBJCE_P(array_ptr); |
|
|
|
if (!ce || !ce->get_iterator) { |
|
|
|
if (!ce->get_iterator) { |
|
|
|
if (IS_CV == IS_CV) { |
|
|
|
Z_ADDREF_P(array_ref); |
|
|
|
} |
|
|
|
@ -34587,7 +34545,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR |
|
|
|
SAVE_OPLINE(); |
|
|
|
expr = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); |
|
|
|
|
|
|
|
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { |
|
|
|
if (Z_TYPE_P(expr) == IS_OBJECT) { |
|
|
|
result = instanceof_function(Z_OBJCE_P(expr), Z_CE_P(EX_VAR(opline->op2.var)) TSRMLS_CC); |
|
|
|
} else { |
|
|
|
result = 0; |
|
|
|
@ -34659,16 +34617,12 @@ static int ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR |
|
|
|
break; |
|
|
|
case IS_OBJECT: |
|
|
|
if (Z_TYPE_P(value) == opline->extended_value) { |
|
|
|
if (Z_OBJ_HT_P(value)->get_class_entry == NULL) { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(value); |
|
|
|
if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 |
|
|
|
&& !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
} else { |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
ZVAL_TRUE(EX_VAR(opline->result.var)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
ZVAL_FALSE(EX_VAR(opline->result.var)); |
|
|
|
|