diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-13 19:19:24 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-13 19:24:12 +0200 |
commit | 1a4a9eede59b853f11e8e8b965e5f715f53da8f7 (patch) | |
tree | 6f33a2502aa5c8bff7f8f38eb27c69812f8a5cb9 /ext/standard/tests | |
parent | 5a0da281e5a9fa02db18b4822d8b103c65849fa9 (diff) | |
download | php-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/tests')
-rw-r--r-- | ext/standard/tests/array/bug67064.phpt | 17 |
1 files changed, 17 insertions, 0 deletions
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) |