}
properties = Z_OBJPROP_P(array_ptr);
- if (zend_hash_num_elements(properties) == 0) {
- ZEND_VM_C_GOTO(fe_reset_r_empty);
- }
-
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (OP1_TYPE != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
+
+ if (zend_hash_num_elements(properties) == 0) {
+ Z_FE_ITER_P(result) = (uint32_t) -1;
+ FREE_OP1_IF_VAR();
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
+ }
+
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
FREE_OP1_IF_VAR();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
-ZEND_VM_C_LABEL(fe_reset_r_empty):
ZVAL_UNDEF(EX_VAR(opline->result.var));
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
FREE_OP1();
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
+ FREE_OP1_VAR_PTR();
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
}
properties = Z_OBJPROP_P(array_ptr);
- if (zend_hash_num_elements(properties) == 0) {
- goto fe_reset_r_empty;
- }
-
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_CONST != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
+
+ if (zend_hash_num_elements(properties) == 0) {
+ Z_FE_ITER_P(result) = (uint32_t) -1;
+
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
+ }
+
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
-fe_reset_r_empty:
ZVAL_UNDEF(EX_VAR(opline->result.var));
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
+
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
}
properties = Z_OBJPROP_P(array_ptr);
- if (zend_hash_num_elements(properties) == 0) {
- goto fe_reset_r_empty;
- }
-
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_TMP_VAR != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
+
+ if (zend_hash_num_elements(properties) == 0) {
+ Z_FE_ITER_P(result) = (uint32_t) -1;
+
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
+ }
+
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
-fe_reset_r_empty:
ZVAL_UNDEF(EX_VAR(opline->result.var));
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
zval_ptr_dtor_nogc(free_op1);
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
+
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
}
properties = Z_OBJPROP_P(array_ptr);
- if (zend_hash_num_elements(properties) == 0) {
- goto fe_reset_r_empty;
- }
-
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_VAR != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
+
+ if (zend_hash_num_elements(properties) == 0) {
+ Z_FE_ITER_P(result) = (uint32_t) -1;
+ zval_ptr_dtor_nogc(free_op1);
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
+ }
+
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
-fe_reset_r_empty:
ZVAL_UNDEF(EX_VAR(opline->result.var));
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
zval_ptr_dtor_nogc(free_op1);
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
+ if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}
}
properties = Z_OBJPROP_P(array_ptr);
- if (zend_hash_num_elements(properties) == 0) {
- goto fe_reset_r_empty;
- }
-
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
if (IS_CV != IS_TMP_VAR) {
Z_ADDREF_P(array_ptr);
}
+
+ if (zend_hash_num_elements(properties) == 0) {
+ Z_FE_ITER_P(result) = (uint32_t) -1;
+
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
+ }
+
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
} else {
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
-fe_reset_r_empty:
ZVAL_UNDEF(EX_VAR(opline->result.var));
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
properties = Z_OBJPROP_P(array_ptr);
if (zend_hash_num_elements(properties) == 0) {
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
+
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
}