Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86736 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37466 invoked from network); 17 Jun 2015 20:41:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jun 2015 20:41:14 -0000 Authentication-Results: pb1.pair.com header.from=kevinbradwick@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kevinbradwick@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: kevinbradwick@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:34176] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/C1-24349-86BD1855 for ; Wed, 17 Jun 2015 16:41:13 -0400 Received: by lbbti3 with SMTP id ti3so39635853lbb.1 for ; Wed, 17 Jun 2015 13:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Lx3rAgTdL0Pzg+tmqibXvfrwF53sMiqtdFfP3KxFOrc=; b=lfQw+MZkcezeNJdz4oR6OpO8Gjyjv8uGqktRenNvP3BTXmewlh5R3Vwb78L9rN5qqZ YMXB2YYLzDl05abQDCtcgVSfLXULn2tmStFfow9fedYjZ3Km6x0+9lNyodkTGl2Fdvz7 qdvBGkBt3W0xoOH9mczBzuyVJXeG9FNOaNfbNi4OSeayAgEwxMU6XYk7bqtJdf4aDp7c QsiNDu+6NKLdSEr78LpJE6GBz05870grKEtYRoDZiglRjPXw/0RGf3ahFFYSd18OKEis mpj1vKQzr7gbJcboo7HQ2x0842D7Ii8N23q6V3dKfUS7eN/9cOyjGrF9TSb8bUS4hXSn IR7g== MIME-Version: 1.0 X-Received: by 10.152.5.2 with SMTP id o2mr9772367lao.79.1434573669903; Wed, 17 Jun 2015 13:41:09 -0700 (PDT) Received: by 10.112.180.197 with HTTP; Wed, 17 Jun 2015 13:41:09 -0700 (PDT) Date: Wed, 17 Jun 2015 21:41:09 +0100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=089e013d1006ffb4780518bcb597 Subject: RFC - making the Exception class abstract From: kevinbradwick@gmail.com (Kevin Bradwick) --089e013d1006ffb4780518bcb597 Content-Type: text/plain; charset=UTF-8 Hello! This is my first post to the internals list so please forgive me if I have not followed the rules precisely! I've had an idea to improve how developers use exceptions within PHP. I'd like to add an RFC but as per the instructions on the site , I am sending this email first gauge reaction as an initial idea. The idea is to change the base Exception class to be abstract. The reason for this is to encourage developers to extend it to create meaning exceptions or use the standard SPL exceptions. The documentation states that it's the base class for all exceptions, which kind of encourages my thought process. Too many times have I seen developers throwing Exceptions when what they really needed was something that gave it context like InvalidArgumentException or RuntimeException. Yes, I agree this is something to tackle at code review (and I do) but I feel PHP doesn't help the situation by making it an instantiatable class. I struggle to think of a valid reason where it makes sense to throw the root Exception class. Catching the root Exception class is a different matter and there are perfectly valid cases for doing it. So, what does everyone think? Is it worth me pursing the RFC with full details of the idea or am I on my own with this one? Many thanks! Kevin --089e013d1006ffb4780518bcb597--