<?php function foo() { while (true) { yield mt_rand(1, 2) => 'foo'; } } $foo = foo(); $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL; $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL; $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL; $foo->next(); echo $foo->key(), ' => ', $foo->current(), PHP_EOL;
You have javascript disabled. You will not be able to edit any code.