r/PHPhelp • • Jan 21 '26

How does PHP handle Interface looping?

Let's say you have 2 interfaces and 2 classes like this:

interface ExceptionInterface extends \Throwable

interface DomainExceptionInterface extends ExceptionInterface

class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface

class DomainArgumentException extends InvalidArgumentException implements DomainExceptionInterface

InvalidArgumentException and DomainArgumentException essentially both end up using ExceptionInterface at the end.

Does this cause an issue with PHP or is this allowed?

2 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/BaronOfTheVoid Jan 24 '26

Do you have any deeper/other question than

Does this cause an issue with PHP or is this allowed?

?

Because that would already be answered by the test.

ChatGPT and Gemini even say not to do this.

ChatGPT and Gemini generate words based on random chance. It's not a god.