note 124526 deleted from function.iterator-count by cmb
| From: | cmb@php.net | Date: | Fri, 20 Dec 2019 16:39:49 +0000 |
| Subject: | note 124526 deleted from function.iterator-count by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213566@lists.php.net to get a copy of this message | ||
Note Submitter: shaman_master at list dot ru
----
Don't listen Youri:
<?php
$iterator = new ArrayIterator(['foo', null, 'bar', 'baz']);
// int(4), int(4)
var_dump(count($iterator), iterator_count($iterator));
$filterIterator = new CallbackFilterIterator(
$iterator,
function ($value, $key, $iterator) {
return $value !== null;
}
);
// int(1), int(3)
var_dump(count($filterIterator), iterator_count($filterIterator));
?>