Skip to content

Instantly share code, notes, and snippets.

@chrisguitarguy
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisguitarguy/ed3979ddf76beebaeeec to your computer and use it in GitHub Desktop.
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/
<?php
interface Spam extends \Traversable
{
// ...
}
final class Ham implements Spam, \IteratorAggregate
{
public function getIterator()
{
return new \ArrayIterator(range(1, 10));
}
}
<?php
interface Spam extends \Traversable
{
// ...
}
<?php
interface Spam extends \Traversable
{
// ...
}
final class Ham implements \IteratorAggregate, Spam
{
public function getIterator()
{
return new \ArrayIterator(range(1, 10));
}
}
<?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