mirror of
https://github.com/php/php-src.git
synced 2024-10-01 14:56:10 +00:00
1a4a9eede5
You can use an optional parameter now when implementing the Countable interface to get the $mode passed to count().
18 lines
279 B
PHP
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)
|