int result;
zend_call_method_with_0_params(object, iter->ce, &iter->ce->iterator_funcs_ptr->zf_valid, "valid", &more);
- if (Z_TYPE(more) != IS_UNDEF) {
- result = i_zend_is_true(&more);
- zval_ptr_dtor(&more);
- return result ? SUCCESS : FAILURE;
- }
+ result = i_zend_is_true(&more);
+ zval_ptr_dtor(&more);
+ return result ? SUCCESS : FAILURE;
}
return FAILURE;
}
ZVAL_COPY_DEREF(&tmp_offset, offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", &retval, &tmp_offset);
- if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
+ result = i_zend_is_true(&retval);
+ zval_ptr_dtor(&retval);
+ if (check_empty && result && EXPECTED(!EG(exception))) {
+ zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset);
result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
- if (check_empty && result && EXPECTED(!EG(exception))) {
- zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset);
- if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
- result = i_zend_is_true(&retval);
- zval_ptr_dtor(&retval);
- }
- }
- } else {
- result = 0;
}
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
GC_ADDREF(zobj);
(*guard) |= IN_ISSET; /* prevent circular getting */
zend_std_call_issetter(zobj, member, &rv);
- if (Z_TYPE(rv) != IS_UNDEF) {
- result = zend_is_true(&rv);
- zval_ptr_dtor(&rv);
- if (has_set_exists == ZEND_PROPERTY_NOT_EMPTY && result) {
- if (EXPECTED(!EG(exception)) && zobj->ce->__get && !((*guard) & IN_GET)) {
- (*guard) |= IN_GET;
- zend_std_call_getter(zobj, member, &rv);
- (*guard) &= ~IN_GET;
- if (Z_TYPE(rv) != IS_UNDEF) {
- result = i_zend_is_true(&rv);
- zval_ptr_dtor(&rv);
- } else {
- result = 0;
- }
- } else {
- result = 0;
- }
+ result = zend_is_true(&rv);
+ zval_ptr_dtor(&rv);
+ if (has_set_exists == ZEND_PROPERTY_NOT_EMPTY && result) {
+ if (EXPECTED(!EG(exception)) && zobj->ce->__get && !((*guard) & IN_GET)) {
+ (*guard) |= IN_GET;
+ zend_std_call_getter(zobj, member, &rv);
+ (*guard) &= ~IN_GET;
+ result = i_zend_is_true(&rv);
+ zval_ptr_dtor(&rv);
+ } else {
+ result = 0;
}
}
(*guard) &= ~IN_ISSET;
zend_call_method_with_1_params(object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset);
zval_ptr_dtor(offset);
- if (!Z_ISUNDEF(rv) && zend_is_true(&rv)) {
+ if (zend_is_true(&rv)) {
zval_ptr_dtor(&rv);
if (check_empty != 1) {
return 1;
while (intern->u.dir.index < pos) {
int valid = 0;
zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval);
- if (!Z_ISUNDEF(retval)) {
- valid = zend_is_true(&retval);
- zval_ptr_dtor(&retval);
- }
+ valid = zend_is_true(&retval);
+ zval_ptr_dtor(&retval);
if (!valid) {
zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position " ZEND_LONG_FMT " is out of range", pos);
return;
if (intern->fptr_offset_has) {
zval rv;
+ zend_bool result;
+
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, intern->std.ce, &intern->fptr_offset_has, "offsetExists", &rv, offset);
zval_ptr_dtor(offset);
- if (!Z_ISUNDEF(rv)) {
- zend_bool result = zend_is_true(&rv);
- zval_ptr_dtor(&rv);
- return result;
- }
- return 0;
+ result = zend_is_true(&rv);
+ zval_ptr_dtor(&rv);
+ return result;
}
return spl_fixedarray_object_has_dimension_helper(intern, offset, check_empty);
apply_info->count++;
zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL);
- if (Z_TYPE(retval) != IS_UNDEF) {
- result = zend_is_true(&retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
- zval_ptr_dtor(&retval);
- } else {
- result = ZEND_HASH_APPLY_STOP;
- }
+ result = zend_is_true(&retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
+ zval_ptr_dtor(&retval);
return result;
}
/* }}} */
fci.params = args;
if (zend_call_function(&fci, &fci_cache) == SUCCESS) {
+ int retval_true;
+
zval_ptr_dtor(&args[0]);
if (use_type == ARRAY_FILTER_USE_BOTH) {
zval_ptr_dtor(&args[1]);
}
- if (!Z_ISUNDEF(retval)) {
- int retval_true = zend_is_true(&retval);
-
- zval_ptr_dtor(&retval);
- if (!retval_true) {
- continue;
- }
- } else {
+ retval_true = zend_is_true(&retval);
+ zval_ptr_dtor(&retval);
+ if (!retval_true) {
continue;
}
} else {
php_error_docref(NULL, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!",
us->wrapper->classname);
ret = PHP_STREAM_OPTION_RETURN_ERR;
- } else if (Z_TYPE(retval) != IS_UNDEF && zend_is_true(&retval)) {
+ } else if (zend_is_true(&retval)) {
ret = PHP_STREAM_OPTION_RETURN_OK;
} else {
ret = PHP_STREAM_OPTION_RETURN_ERR;
us->wrapper->classname);
break;
}
- if (Z_ISUNDEF(retval) || !zend_is_true(&retval)) {
+ if (!zend_is_true(&retval)) {
break;
}
php_stream_from_zval_no_verify(intstream, &retval);