they don't need to return a value. Adjusted reset() to work with this.
It is a bit problematic because if internal functions don't look at the
flag and still return a value orginally this leaked. So I free the value
in any case, which kind of makes the speed gain a bit smaller
if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) {
return;
}
-
- *return_value = **entry;
- pval_copy_constructor(return_value);
- INIT_PZVAL(return_value); /* XXX is this needed? */
+
+ if (used_return_value) {
+ *return_value = **entry;
+ pval_copy_constructor(return_value);
+ /* INIT_PZVAL(return_value); XXX is this needed? - No! :) */
+ }
}
PHP_FUNCTION(current)