Last active
August 29, 2015 14:19
-
-
Save chrisguitarguy/ed3979ddf76beebaeeec to your computer and use it in GitHub Desktop.
Some example code for a blog post on https://www.pmg.com/blog/
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
<?php | |
interface Spam extends \Traversable | |
{ | |
// ... | |
} | |
final class Ham implements Spam, \IteratorAggregate | |
{ | |
public function getIterator() | |
{ | |
return new \ArrayIterator(range(1, 10)); | |
} | |
} |
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
<?php | |
interface Spam extends \Traversable | |
{ | |
// ... | |
} |
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
<?php | |
interface Spam extends \Traversable | |
{ | |
// ... | |
} | |
final class Ham implements \IteratorAggregate, Spam | |
{ | |
public function getIterator() | |
{ | |
return new \ArrayIterator(range(1, 10)); | |
} | |
} |
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
<?php | |
interface Foo extends \Iterator | |
{ | |
// ... | |
} | |
interface Bar extends \IteratorAggregate | |
{ | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment