Last active
July 22, 2016 12:28
-
-
Save andkirby/65c36c14cf1dfe796a967a8877d5f7e4 to your computer and use it in GitHub Desktop.
This file contains 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
$a = new ArrayIterator; | |
$a->append(++$cnt); | |
$a->append(++$cnt); | |
foreach ($a as $i => $item) { | |
$cnt < 5 && $a->append(++$cnt); | |
var_dump($item); | |
} | |
//int(1) | |
//int(2) | |
//int(3) | |
//int(4) | |
//int(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment