Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function yield_test() {
- $timestart=time();
- print "first element retrieved... ";
- yield (time()-$timestart);
- print "second element retrieved... ";
- yield (time()-$timestart);
- print "third element retrieved... ";
- yield (time()-$timestart);
- }
- foreach (yield_test() as $v ) {
- print $v." seconds passed\n";
- sleep(2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement