r/PHPhelp • u/Fluent_Press2050 • 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 DomainExceptionInterfaceInvalidArgumentException and DomainArgumentException essentially both end up using ExceptionInterface at the end.
Does this cause an issue with PHP or is this allowed?
2
Upvotes
View all comments
Show parent comment
4
u/zarlo5899 Jan 21 '26
Now why would someone do that when they can just ask the internet?