diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-13 19:27:43 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-13 19:27:43 +0200 |
| commit | fb99409f89c5a395a8e5c938f9ae6c941c301cc5 (patch) | |
| tree | 68f9890c71f11278dc801d442ccbc68397ae64dd | |
| parent | a3eafe535f0456b2f7bbbfe4dd86ffe20b5e724b (diff) | |
| parent | eca0644e0acb391540e40a320e10782225654baf (diff) | |
| download | php-git-fb99409f89c5a395a8e5c938f9ae6c941c301cc5.tar.gz | |
Merge branch 'PHP-5.5' into PHP-5.6
| -rw-r--r-- | ext/standard/array.c | 5 | ||||
| -rw-r--r-- | ext/standard/tests/array/bug67064.phpt | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 6c3be814cb..34057e34c8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -336,7 +336,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)); diff --git a/ext/standard/tests/array/bug67064.phpt b/ext/standard/tests/array/bug67064.phpt new file mode 100644 index 0000000000..e1996e36b6 --- /dev/null +++ b/ext/standard/tests/array/bug67064.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #67064 () +--FILE-- +<?php +class Counter implements Countable { + public function count($mode = COUNT_NORMAL) { + var_dump($mode == COUNT_RECURSIVE); + return 1; + } +} + +$counter = new Counter; +var_dump(count($counter, COUNT_RECURSIVE)); +?> +--EXPECTF-- +bool(true) +int(1) |
