summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2014-04-13 19:19:24 +0200
committerBob Weinand <bobwei9@hotmail.com>2014-04-13 19:24:12 +0200
commit1a4a9eede59b853f11e8e8b965e5f715f53da8f7 (patch)
tree6f33a2502aa5c8bff7f8f38eb27c69812f8a5cb9 /ext/standard/array.c
parent5a0da281e5a9fa02db18b4822d8b103c65849fa9 (diff)
downloadphp-git-1a4a9eede59b853f11e8e8b965e5f715f53da8f7.tar.gz
Fix bug #67064 in a BC safe way
You can use an optional parameter now when implementing the Countable interface to get the $mode passed to count().
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index c2efca58fc..f807bb5ad1 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -333,7 +333,10 @@ 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)) {
- zend_call_method_with_0_params(&array, NULL, NULL, "count", &retval);
+ zval *mode_zv;
+ MAKE_STD_ZVAL(mode_zv);
+ Z_LVAL_P(mode_zv) = mode;
+ zend_call_method_with_1_params(&array, NULL, NULL, "count", &retval, mode_zv);
if (retval) {
convert_to_long_ex(&retval);
RETVAL_LONG(Z_LVAL_P(retval));