Last active
November 7, 2016 15:15
-
-
Save thomaslorentsen/33bb9181b206cd8b86b2c5897e5a79b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @see http://php.net/manual/en/class.generator.php | |
// @see http://php.net/manual/en/class.generator.php | |
function getRange ($max = 10) { | |
for ($i = 1; $i < $max; $i++) { | |
yield $k => $i; | |
} | |
} | |
foreach (getRange(PHP_INT_MAX) as $range) { | |
echo "Dataset {$range} <br>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment