Re: Re: [RFC] Exceptions in the engine

From: Date: Thu, 19 Feb 2015 15:31:30 +0000
Subject: Re: Re: [RFC] Exceptions in the engine
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-83208@lists.php.net to get a copy of this message
On 19 February 2015 at 09:54, Dmitry Stogov <dmitry@zend.com> wrote: > I think we may introduce the following hierarchy > the existing code that caught Exception is going to be unaffected. We could do that. But it's not obviously correct, and ought to be justified as to why it would be the correct thing to do. The problem of people needing to catch every type of exception could also be solved by using a common interface. class EngineException implements ExceptionInterface {} class Exception implements ExceptionInterface {} try { foo(); } catch(ExceptionInterface $exception) { //catches everything. } This avoids a requirement for all exceptions to extend from a common base class. The interface for exceptions would be the current Exception classes methods, excluding the constructor. > We thought about "Throwable" or "Catchable" interface, but this change > would require more changes and will make more BC breaks. Please can you explain what those problems are? cheers Dan

« previous php.internals (#83208) next »