<?php
interface Spam extends \Traversable
{
// ...
}
final class Ham implements Spam, \IteratorAggregate
{
public function getIterator()
{
return new \ArrayIterator(range(1, 10));
}
}
Deprecated: Return type of Ham::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/X7jYt on line 10
Fatal error: Class Ham must implement interface Traversable as part of either Iterator or IteratorAggregate in Unknown on line 0
Process exited with code 255.
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/X7jYt on line 3
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/X7jYt on line 8
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/X7jYt on line 12
Fatal error: Class Ham must implement interface Traversable as part of either Iterator or IteratorAggregate in Unknown on line 0
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/X7jYt on line 3
Process exited with code 255.