node = NULL;
} else if (sxe->iter.type != SXE_ITER_CHILD) {
- if ( sxe->iter.type == SXE_ITER_NONE || !node->children || !node->parent || node->children->next || node->children->children || node->parent->children == node->parent->last ) {
+ if ( sxe->iter.type == SXE_ITER_NONE || !node->children || !node->parent || !node->next || node->children->next || node->children->children || node->parent->children == node->parent->last ) {
node = node->children;
} else {
- iter_data = sxe->iter.data;
- sxe->iter.data = NULL;
+ ZVAL_COPY_VALUE(&iter_data, &sxe->iter.data);
+ ZVAL_UNDEF(&sxe->iter.data);
- node = php_sxe_reset_iterator(sxe, 0 TSRMLS_CC);
+ node = php_sxe_reset_iterator(sxe, 0);
use_iter = 1;
}