Edit: On the off-chance that anyone else comes across this, I just stumbled across this answer that does a far better job of explaining things: Why can't you inherit from a not-yet-defined class which inherits from a not-yet-defined class?
The separate files aspect of this is actually irrelevant - you can reproduce the same behaviour by simply defining the classes/interfaces out of order.
I don't know nearly enough about PHP's internals to say why any of this happens, but if there is anything more than a very simple inheritance structure, then the classes need to be defined in order.
This works:
<?php
class b extends a {}
class a {}
This does not:
<?php
class c extends b {}
class b extends a {}
class a {}
You can cause similar weirdness when implementing interfaces, as in your question:
Works:
<?php
interface testInterface {}
class b extends a implements testInterface {}
class a {}
Doesn't work:
<?php
interface testInterface {}
class b extends a {}
class a implements testInterface {}
In short: Always declare your interfaces, classes and traits in the order in which they're used. PHP might be able to figure things out for you, but don't rely on it (and I suspect different versions will also behave in subtly different ways). The same conclusion was reached in this question, posted a few years ago by Taylor Otwell, of all people.