cvs: /php4/ext/standard array.c
| From: | Andi Gutmans | Date: | Tue, 16 Nov 1999 18:48:18 +0000 |
| Subject: | cvs: /php4/ext/standard array.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6305@lists.php.net to get a copy of this message | ||
andi Tue Nov 16 13:48:18 1999 EDT
Modified files:
/php4/ext/standard array.c
Log:
- Initial support for Thies' idea of passing functions a flag telling them
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
Index: php4/ext/standard/array.c
diff -u php4/ext/standard/array.c:1.2 php4/ext/standard/array.c:1.3
--- php4/ext/standard/array.c:1.2 Sun Nov 14 14:59:52 1999
+++ php4/ext/standard/array.c Tue Nov 16 13:47:47 1999
@@ -574,10 +574,12 @@
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)