- var_dump: documentation ( source)
<?php
function printer() {
$i=true;
$times=1;
while ($i) {
$string = yield;
yield $string;
$times++;
$i=false;
}
var_dump($i,$times);
}
$printer = printer();
$printer->send('Hello world!');
echo $printer->current();
?>