Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83212 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67066 invoked from network); 19 Feb 2015 15:46:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 15:46:52 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.170 mail-vc0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:38257] helo=mail-vc0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/BF-18870-A6506E45 for ; Thu, 19 Feb 2015 10:46:51 -0500 Received: by mail-vc0-f170.google.com with SMTP id hq12so1415011vcb.1 for ; Thu, 19 Feb 2015 07:46:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=DqeefuyFiZ9A7hWF6aQ5oSW9fORdlFyH3o6cdes9Cg8=; b=OBHMLDHKfxnrXsrIAHQ8CcnVq8kOa0RobYTsoYuJ8dhuQ8l0j4nUKYiCn8KI878xV5 x3aWMeOctapeZQ0irBAqxTCVe5cpt0ymk9v4elaBBU/5WzGs+gUh50yJx4QatLpn5AC6 BEJHq6a37jWOLtMYbCZDzez97ySxZ5WOzB2U/hR4xN8w8s9Kg1in9Mp+Ja7maNHxDtfi WhjB4xtJbLxO2dC4BQiy2SYe2nFs/L36K4ScKjxfMBUqkuaM3oe4DsW0E6c0VbJpwlrV wKCvJW56KOrgWLtW0x9PzSn536Z7qvXWdhNWyOcyab27hGvRPONRVM+7Ka7FLDqcT5Ih yAsg== X-Gm-Message-State: ALoCoQkk4E1MrKwWfTyE+5eZXrvfxRXoFtZonAyRa3RGJWGEaUTUTzDiftyPzctzBGO2URnq3Or33y4tM3qNX7+KUAiO3oXWVceCH6d3qUST8b7pODRK4l/By/YwotavYhjixCUr1HcrM1NDSajObXTJdEN9DDI1qA== MIME-Version: 1.0 X-Received: by 10.52.52.136 with SMTP id t8mr2329622vdo.49.1424360807780; Thu, 19 Feb 2015 07:46:47 -0800 (PST) Received: by 10.52.74.73 with HTTP; Thu, 19 Feb 2015 07:46:47 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Feb 2015 19:46:47 +0400 Message-ID: To: Dan Ackroyd Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=089e0115f048fae1f9050f72d71b Subject: Re: [PHP-DEV] Re: [RFC] Exceptions in the engine From: dmitry@zend.com (Dmitry Stogov) --089e0115f048fae1f9050f72d71b Content-Type: text/plain; charset=UTF-8 Exception declares protected properties that may be used in child classes directly. This is not possible with interface. Thanks. Dmitry. On Thu, Feb 19, 2015 at 6:31 PM, Dan Ackroyd wrote: > On 19 February 2015 at 09:54, Dmitry Stogov 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 > --089e0115f048fae1f9050f72d71b--