Skip to content

Instantly share code, notes, and snippets.

@gotterdemarung
Created October 11, 2013 12:04
Show Gist options
  • Save gotterdemarung/6933564 to your computer and use it in GitHub Desktop.
Save gotterdemarung/6933564 to your computer and use it in GitHub Desktop.
Unexpected Traversable behavior
<?php
echo 'Declaring interface: ';
interface T extends Traversable {}
echo 'OK' . PHP_EOL;
echo 'Abstract class with right interfaces order:';
abstract class A implements Iterator, T {} // OK
echo 'OK' . PHP_EOL;
echo 'Abstract class with wrong interfaces order:';
abstract class B implements T, Iterator {} // Fails
echo 'You will never see this line' . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment