Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15027 invoked from network); 13 May 2015 07:38:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 May 2015 07:38:03 -0000 Authentication-Results: pb1.pair.com header.from=sebastian@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sebastian@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 93.190.64.238 as permitted sender) X-PHP-List-Original-Sender: sebastian@php.net X-Host-Fingerprint: 93.190.64.238 mail-2.de-punkt.de Received: from [93.190.64.238] ([93.190.64.238:55886] helo=mail-99.de-punkt.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/00-14407-A5FF2555 for ; Wed, 13 May 2015 03:38:03 -0400 Received: from localhost (localhost [127.0.0.1]) by mail-99.de-punkt.de (Postfix) with ESMTP id 879233A2E3 for ; Wed, 13 May 2015 09:37:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail-2.de-punkt.de Received: from mail-99.de-punkt.de ([127.0.0.1]) by localhost (mail-2.de-punkt.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0MORW6M-kRqB for ; Wed, 13 May 2015 09:37:58 +0200 (CEST) Received: from [192.168.178.24] (p4FC7DFE5.dip0.t-ipconnect.de [79.199.223.229]) (Authenticated sender: php@sebastian-bergmann.de) by mail-99.de-punkt.de (Postfix) with ESMTPSA id 35AFD3A2D1 for ; Wed, 13 May 2015 09:37:58 +0200 (CEST) Message-ID: <5552FF58.8070807@php.net> Date: Wed, 13 May 2015 09:38:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: internals@lists.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> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [VOTE] Exceptions in the engine From: sebastian@php.net (Sebastian Bergmann) 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.