Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87327 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20185 invoked from network); 27 Jul 2015 17:55:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2015 17:55:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:36373] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/84-17059-19076B55 for ; Mon, 27 Jul 2015 13:55:30 -0400 Received: by wicgb10 with SMTP id gb10so123146521wic.1 for ; Mon, 27 Jul 2015 10:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=RoNa2yRk5ujjRlAzsHS9qCTJIhDT7K7Bd+SZQ6lu3dU=; b=I6FW7KWqmljsTUHhGlNQqdNFRUsLu8hFQwkb3+AjVCVpO3NlE1A6MEA5ab2VhAGVcC Ex5+CWaJC2OCSo8KEXqy9jxPMrNSRGv4tp1VxO9j2z+jYQhWe3ApxmpDdiBwIV/gPB1A JB2fBNtBf4ac/VIvSmKGCNKfMB8cTuaVw4jUVSwdifrx4qAl/mJ0p2ovc+H+shK1IHTy opJ2KkLvEvps/D2SBRdJn9zC4si/ds5CWdBqE8I7RJBL7wutNIlU979cidcb/Z0dl0Hu LKEx+m+vcFfAaqkUhhMAAOdexbJK1qIvowfQAQ4evTpTdOnA6PExXlu9wDycrMs5qtVd rz2Q== X-Received: by 10.194.78.210 with SMTP id d18mr55200649wjx.34.1438019726819; Mon, 27 Jul 2015 10:55:26 -0700 (PDT) Received: from [192.168.0.136] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id lz10sm29013796wjb.48.2015.07.27.10.55.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 10:55:26 -0700 (PDT) To: Scott Arciszewski References: <836BA21C-AE99-4E7B-AB06-EBC30E41BA0E@icicle.io> <0AD335F5-35F3-4D98-8F82-800A1EDF8FD8@icicle.io> <05f101d0c838$fcdab5e0$f69021a0$@belski.net> <55B63FDF.6050100@gmail.com> <55B66494.1020106@gmail.com> Cc: PHP Internals Message-ID: <55B6707A.3040405@gmail.com> Date: Mon, 27 Jul 2015 18:55:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Core functions throwing exceptions in PHP7 From: rowan.collins@gmail.com (Rowan Collins) Scott Arciszewski wrote on 27/07/2015 18:35: > I understand that some of the Internals contributors are allergic to > special cases. There's some validity to wanting the language to be > predictable and consistent across the board, because that might be a > UX concern in and of itself. (What do you mean this one function has > to be wrapped in try-catch blocks when the others can be prefixed with > @ to silence errors? I'm telling PHPSadness!) This is certainly some people's concern, but Anatol has raised a subtly different consistency-related point, which is this: Since we have no policy for what kinds of Throwable should be emitted in what circumstance, throwing anything in this function sets a precedent which will have to be incorporated in any future plan. Assuming nobody is fundamentally against ever adding Throwables to core functions, there are a minimum number of questions that need to be agreed before adding the first one: - when should we inherit from Error and when from Exception? - is it ever OK to throw a plain Error or Exception (thus forcing users into the otherwise bad practice of catching those base classes)? - if not throwing the base class, how specific should sub-classes be? (i.e. a framework for defining the hierarchy, not necessarily the hierarchy itself) If we can get agreement on those points in time for 7.0, fine, but time is very tight, and the window for such discussions has theoretically closed... Regards, -- Rowan Collins [IMSoP]