SAVE_OPLINE();
if (OP1_TYPE != IS_UNUSED) {
zend_free_op free_op1;
- zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
-
- do {
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- } else {
- if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) {
- ptr = Z_REFVAL_P(ptr);
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- break;
- }
- }
- zend_print_variable(ptr);
- }
- } while (0);
+ zval *ptr = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
+
+ if (Z_TYPE_P(ptr) == IS_LONG) {
+ EG(exit_status) = Z_LVAL_P(ptr);
+ } else if (Z_TYPE_P(ptr) == IS_TRUE || Z_TYPE_P(ptr) == IS_FALSE || Z_TYPE_P(ptr) == IS_NULL) {
+ EG(exit_status) = Z_TYPE_P(ptr) == IS_TRUE;
+ } else if (Z_TYPE_P(ptr) == IS_DOUBLE) {
+ EG(exit_status) = (int) Z_DVAL_P(ptr);
+ } else {
+ zend_print_variable(ptr);
+ }
FREE_OP1();
}
zend_bailout();
zval *ptr = EX_CONSTANT(opline->op1);
- do {
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- } else {
- if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) {
- ptr = Z_REFVAL_P(ptr);
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- break;
- }
- }
- zend_print_variable(ptr);
- }
- } while (0);
+ if (Z_TYPE_P(ptr) == IS_LONG) {
+ EG(exit_status) = Z_LVAL_P(ptr);
+ } else if (Z_TYPE_P(ptr) == IS_TRUE || Z_TYPE_P(ptr) == IS_FALSE || Z_TYPE_P(ptr) == IS_NULL) {
+ EG(exit_status) = Z_TYPE_P(ptr) == IS_TRUE;
+ } else if (Z_TYPE_P(ptr) == IS_DOUBLE) {
+ EG(exit_status) = (int) Z_DVAL_P(ptr);
+ } else {
+ zend_print_variable(ptr);
+ }
}
zend_bailout();
zval *ptr = NULL;
- do {
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- } else {
- if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) {
- ptr = Z_REFVAL_P(ptr);
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- break;
- }
- }
- zend_print_variable(ptr);
- }
- } while (0);
+ if (Z_TYPE_P(ptr) == IS_LONG) {
+ EG(exit_status) = Z_LVAL_P(ptr);
+ } else if (Z_TYPE_P(ptr) == IS_TRUE || Z_TYPE_P(ptr) == IS_FALSE || Z_TYPE_P(ptr) == IS_NULL) {
+ EG(exit_status) = Z_TYPE_P(ptr) == IS_TRUE;
+ } else if (Z_TYPE_P(ptr) == IS_DOUBLE) {
+ EG(exit_status) = (int) Z_DVAL_P(ptr);
+ } else {
+ zend_print_variable(ptr);
+ }
}
zend_bailout();
SAVE_OPLINE();
if (IS_CV != IS_UNUSED) {
- zval *ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var);
+ zval *ptr = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var);
- do {
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- } else {
- if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) {
- ptr = Z_REFVAL_P(ptr);
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- break;
- }
- }
- zend_print_variable(ptr);
- }
- } while (0);
+ if (Z_TYPE_P(ptr) == IS_LONG) {
+ EG(exit_status) = Z_LVAL_P(ptr);
+ } else if (Z_TYPE_P(ptr) == IS_TRUE || Z_TYPE_P(ptr) == IS_FALSE || Z_TYPE_P(ptr) == IS_NULL) {
+ EG(exit_status) = Z_TYPE_P(ptr) == IS_TRUE;
+ } else if (Z_TYPE_P(ptr) == IS_DOUBLE) {
+ EG(exit_status) = (int) Z_DVAL_P(ptr);
+ } else {
+ zend_print_variable(ptr);
+ }
}
zend_bailout();
SAVE_OPLINE();
if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) {
zend_free_op free_op1;
- zval *ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
+ zval *ptr = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
- do {
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- } else {
- if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) {
- ptr = Z_REFVAL_P(ptr);
- if (Z_TYPE_P(ptr) == IS_LONG) {
- EG(exit_status) = Z_LVAL_P(ptr);
- break;
- }
- }
- zend_print_variable(ptr);
- }
- } while (0);
+ if (Z_TYPE_P(ptr) == IS_LONG) {
+ EG(exit_status) = Z_LVAL_P(ptr);
+ } else if (Z_TYPE_P(ptr) == IS_TRUE || Z_TYPE_P(ptr) == IS_FALSE || Z_TYPE_P(ptr) == IS_NULL) {
+ EG(exit_status) = Z_TYPE_P(ptr) == IS_TRUE;
+ } else if (Z_TYPE_P(ptr) == IS_DOUBLE) {
+ EG(exit_status) = (int) Z_DVAL_P(ptr);
+ } else {
+ zend_print_variable(ptr);
+ }
zval_ptr_dtor_nogc(free_op1);
}
zend_bailout();
"CONST" => "EX_CONSTANT(opline->op1)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var)",
- "TMPVAR" => "???",
+ "TMPVAR" => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1)",
);
$op2_get_zval_ptr_deref = array(
"CONST" => "EX_CONSTANT(opline->op2)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var)",
- "TMPVAR" => "???",
+ "TMPVAR" => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2)",
);
$op1_get_zval_ptr_undef = array(