- var_dump: documentation ( source)
<?php
function printer() {
echo "I'm printer!".PHP_EOL;
while (true) {
$string = yield 'yielded';
echo $string.PHP_EOL;
}
}
$printer = printer();
$printer->rewind();
var_dump($printer->current());
//$printer->send('Hello world!');
//$printer->send('Bye world!');
?>