php-src/ext/standard/tests/array/bug67064.phpt
Bob Weinand 1a4a9eede5 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().
2014-04-13 19:24:12 +02:00

18 lines
279 B
PHP

--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)