- assert: documentation ( source)
<?php exit();
$countMap = (function(){
yield "a" => 5;
yield "b" => 2;
yield "c" => 3;
})();
// emits "C" times the element "K" from the given Iterator<K, C>
$iterator = new MultiplyIterator($countMap); // better name for this?
$iterator->rewind();
assert($iterator->current() === "a"); $iterator->next();
assert($iterator->current() === "a"); $iterator->next();
assert($iterator->current() === "a"); $iterator->next();
assert($iterator->current() === "a"); $iterator->next();
assert($iterator->current() === "a"); $iterator->next();
assert($iterator->current() === "b"); $iterator->next();
assert($iterator->current() === "b"); $iterator->next();
assert($iterator->current() === "c"); $iterator->next();
assert($iterator->current() === "c"); $iterator->next();
assert($iterator->current() === "c"); $iterator->next();