Skip to content

Instantly share code, notes, and snippets.

@markijbema
Created June 25, 2013 15:34
Show Gist options
  • Save markijbema/5859456 to your computer and use it in GitHub Desktop.
Save markijbema/5859456 to your computer and use it in GitHub Desktop.
#!/usr/bin/php
<?php
function getFibonacci()
{
$k = 0;
while(true){
$k++;
$a = (yield $k);
echo "yo" . $a . "\n";
}
}
$y = 30000;
$it = getFibonacci();
foreach($it as $fibonacci)
{
$it->send('gerrit'.$y);
echo $fibonacci;
echo $fibonacci . " henk \n";
echo "hoi\n";
$y++;
if($y > 30030)
{
break; // infinite loop prevent
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment