summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-08-04 13:56:27 +0400
committerDmitry Stogov <dmitry@zend.com>2014-08-04 13:56:27 +0400
commit7301994c28d548c5a4eda6a3a4ae0fab6af04636 (patch)
tree4058df108a4ea2499c850a23eb7cf3850dd2941d /ext/standard/array.c
parent863a603fada3ce107cb402683bc79dce1359c463 (diff)
parentfe894c2154e6b013f0d0b29ca660ad719fd1affe (diff)
downloadphp-git-7301994c28d548c5a4eda6a3a4ae0fab6af04636.tar.gz
Merge branch 'master' into phpng
* master: (46 commits) PHP_INT_MIN and _MAX tests NEWS and UPGRADING Added PHP_INT_MIN Fix wrong lenght size Bug #51096 - Remove unnecessary ? for first/last day of Moved streams related functions to xp_ssl.c Remove duplicate NEWS Update NEWS Update NEWS Update NEWS BFN BFN Fixed bug #67715 (php-milter does not build and crashes randomly). We need to turn off any strict mode here for this warning to show up Disable restrictions regarding arrays in constants at run-time. For the discussion around it, see the thread on the mailing list: http://www.mail-archive.com/internals@lists.php.net/msg68245.html Revert "Fix bug #67064 in a BC safe way" Updated NEWS for #67693 Updated NEWS for #67693 Fixed bug #67693 - incorrect push to the empty array add missing entry to NEWS ... Conflicts: Zend/tests/errmsg_040.phpt Zend/tests/ns_059.phpt Zend/zend_language_parser.y Zend/zend_vm_def.h ext/openssl/openssl.c ext/reflection/php_reflection.c ext/session/session.c ext/spl/spl_directory.c ext/spl/spl_iterators.c ext/sqlite3/sqlite3.c ext/standard/array.c
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 731c374582..a177ee7e0f 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -332,14 +332,11 @@ PHP_FUNCTION(count)
#ifdef HAVE_SPL
/* if not and the object implements Countable we call its count() method */
if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
- zval mode_zv;
- ZVAL_LONG(&mode_zv, mode);
- zend_call_method_with_1_params(array, NULL, NULL, "count", &retval, &mode_zv);
+ zend_call_method_with_0_params(array, NULL, NULL, "count", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
RETVAL_LONG(zval_get_long(&retval));
zval_ptr_dtor(&retval);
}
- zval_ptr_dtor(&mode_zv);
return;
}
#endif
@@ -2085,7 +2082,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
zend_hash_rehash(Z_ARRVAL_P(stack));
}
}
- } else if (!key && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
+ } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1;
}