diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2010-12-12 19:27:04 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2010-12-12 19:27:04 +0000 |
| commit | 9696faa7907e468ebc25fe9cce020d6c4d287c09 (patch) | |
| tree | c5745e3b3d7054602fcf9549adcb0e78661c79e4 /ext/standard/array.c | |
| parent | c6bbf9ee57c39ade0563abd2e44ccd7d6f35fca0 (diff) | |
| download | php-git-9696faa7907e468ebc25fe9cce020d6c4d287c09.tar.gz | |
Fixed bug 48484 (array_product() always returns 0 for an empty array).
Diffstat (limited to 'ext/standard/array.c')
| -rw-r--r-- | ext/standard/array.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 83b2bf65b6..7c8a2e43e3 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4052,10 +4052,10 @@ PHP_FUNCTION(array_product) return; } + ZVAL_LONG(return_value, 1); if (!zend_hash_num_elements(Z_ARRVAL_P(input))) { - RETURN_LONG(0); + return; } - ZVAL_LONG(return_value, 1); for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(input), &pos); zend_hash_get_current_data_ex(Z_ARRVAL_P(input), (void **)&entry, &pos) == SUCCESS; |
