iliaa Sun Oct 30 08:44:29 2005 EDT
Added files: (Branch: PHP_5_1)
/php-src/ext/standard/tests/array bug35014.phpt
Modified files:
/php-src NEWS
/php-src/ext/standard array.c
Log:
Fixed Bug #35014 (array_product() always returns 0).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.168&r2=1.2027.2.169&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.168 php-src/NEWS:1.2027.2.169
--- php-src/NEWS:1.2027.2.168 Fri Oct 28 11:00:46 2005
+++ php-src/NEWS Sun Oct 30 08:44:22 2005
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Nov 2005, PHP 5.1
+- Fixed bug #35014 (array_product() always returns 0). (Ilia)
28 Oct 2005, PHP 5.1 Release Candidate 4
- Fixed fgetcsv() and fputcsv() inconsistency. (Dmitry)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.308.2.10&r2=1.308.2.11&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.10
php-src/ext/standard/array.c:1.308.2.11
--- php-src/ext/standard/array.c:1.308.2.10 Fri Oct 28 05:57:35 2005
+++ php-src/ext/standard/array.c Sun Oct 30 08:44:26 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.308.2.10 2005/10/28 09:57:35 dmitry Exp $ */
+/* $Id: array.c,v 1.308.2.11 2005/10/30 13:44:26 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -3996,8 +3996,12 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument
should be an array");
return;
}
-
- ZVAL_LONG(return_value, 0);
+
+ if (!zend_hash_num_elements(Z_ARRVAL_PP(input))) {
+ RETURN_LONG(0);
+ return;
+ }
+ ZVAL_LONG(return_value, 1);
for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(input), &pos);
zend_hash_get_current_data_ex(Z_ARRVAL_PP(input), (void
**)&entry, &pos) == SUCCESS;
http://cvs.php.net/co.php/php-src/ext/standard/tests/array/bug35014.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/array/bug35014.phpt
+++ php-src/ext/standard/tests/array/bug35014.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php