Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86223 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95942 invoked from network); 14 May 2015 19:20:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 May 2015 19:20:30 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.178 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.216.178 mail-qc0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:34579] helo=mail-qc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/9A-31470-E75F4555 for ; Thu, 14 May 2015 15:20:30 -0400 Received: by qcyk17 with SMTP id k17so45348149qcy.1 for ; Thu, 14 May 2015 12:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nl64TGFxfjvA6ZNjQjOU/of0XcB6KijpIBCgyUjAxI0=; b=CI4ZTb6KJqWUdonCPbkbboFkSuVj2MFLcf/QkM7I81cSddO4OJBLh4Zm6RgqoENYCm CDioOj/fMCAoVLnkbLb/+W2alfTKtHcqHTVmFGXAOV1ezdLV9R4LcsDnriAYzG56LOwU e11Y9Jfxu39h6u0/5/n13INAS4cA+WEyCpt2nh6iY1WooyznOtgOOHz1CEFT8pNpwjlh jCmAPP2yvSazsPX+mSxDesvOyV6S4Tc+AAX6zWlR20Na2GCfcCgqWOYvch7ljQallQ7l xh+gB8t4PbytNBuyb061j19dtPeZwd3ofHtU4f1jRy1ixUXw9W/wZ0Ro2QNITymyKkPa Rasw== MIME-Version: 1.0 X-Received: by 10.55.15.129 with SMTP id 1mr12749689qkp.29.1431631227355; Thu, 14 May 2015 12:20:27 -0700 (PDT) Received: by 10.96.192.195 with HTTP; Thu, 14 May 2015 12:20:27 -0700 (PDT) In-Reply-To: <5552FF58.8070807@php.net> References: <54F07FC7.8050901@php.net> <54F0839C.3010700@seld.be> <55052FAD.6090608@php.net> <5505346D.7020700@php.net> <550DA4EE.2030903@php.net> <55410973.4010300@php.net> <55417C64.7000707@gmail.com> <5541B4D6.9060503@php.net> <55425D7E.6010803@gmail.com> <554D8F4D.9020903@gmail.com> <554D90CC.3040607@php.net> <5552E3EB.5010800@gmail.com> <5552E494.5070401@php.net> <5552FF58.8070807@php.net> Date: Thu, 14 May 2015 21:20:27 +0200 Message-ID: To: Sebastian Bergmann Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE] Exceptions in the engine From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Wed, May 13, 2015 at 9:38 AM, Sebastian Bergmann wrote: > Am 13.05.2015 um 08:30 schrieb Pierre Joye: >> Why don't you do it? You have access and you are a very good writer. >> No big C knowledge required either in this case :) > > There was/is consensus on what I proposed back in February: > > * Introduce a Throwable interface > * Let Exception implement the Throwable interface > * Introduce an Error class that implements the Throwable interface > * Use Error class as base class for exceptions raised by the engine > > But as simple as the above sounds it is complicated (at least for > me) to implement (properly). Here's what I was able to come up with: > > https://github.com/php/php-src/pull/1274 > > This should give us the following: > > interface Throwable {} > abstract class BaseException implements Throwable {} > class Exception extends BaseException {} > class Error extends BaseException {} > class EngineError extends Error {} > class ParseError extends Error {} > class TypeError extends Error {} > > I am not sure whether we still want the abstract BaseException > class. I left it in because I couldn't figure out how to remove > it without breaking Exception and Error. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > Hello, I personally dislike the BaseException. Does it have to be there? If it's just for sharing some behavior between Exception and Error, wouldn't trait be an acceptable (but definitely not perfect) solution? Regards Pavel Kouril