Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87279 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31588 invoked from network); 24 Jul 2015 23:58:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2015 23:58:14 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.172 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.172 mail-pd0-f172.google.com Received: from [209.85.192.172] ([209.85.192.172:34481] helo=mail-pd0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/92-10459-511D2B55 for ; Fri, 24 Jul 2015 19:58:14 -0400 Received: by pdbbh15 with SMTP id bh15so20412536pdb.1 for ; Fri, 24 Jul 2015 16:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=bv5aAaf9jDJNFOF+1ydzsyHY+XTwNFuUHmPN9Ryi58s=; b=MeEn/1tTGfNHin3JZUawbZ0sxveHZfl86fxNLwAWymmu5WxiycmujflSZi+j7xGxEx BxwYyHVwAdrV5zDADYUWZJrqY6YVsp0g2nJgM6JySbhtfHNRLvVIv++NzAWTeUF6ULtf F7PIO/7dRMhqXINf9xbvjJ+hI03xptPuzOZpX0yCjwJd1X7JtXxbN4kgODBvIh7e1XwO bbAI7sy4iNCARmzxpYYfiPHPCPhOZHOQtdRtDVPokSJ8IY9i0KhM3fpdWLeUzYSUZF1n v0DPGwN+bGBV2bmCP5JCmLSka5wXF9B+8b+T0BfXayQGdr6fxWG7oeM3OZvbn0TF3u27 ksIg== X-Received: by 10.70.65.5 with SMTP id t5mr37665656pds.16.1437782291123; Fri, 24 Jul 2015 16:58:11 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by smtp.gmail.com with ESMTPSA id bf5sm16656331pad.43.2015.07.24.16.58.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 16:58:10 -0700 (PDT) To: Rowan Collins , internals@lists.php.net References: <55A63C90.8000705@gmail.com> X-Enigmail-Draft-Status: N1110 Message-ID: <55B2D10D.4030807@gmail.com> Date: Fri, 24 Jul 2015 16:58:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55A63C90.8000705@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Core functions throwing exceptions in PHP7 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Given that the *engine itself* now throws exceptions, and we have > bundled extensions which throw exceptions, the blanket ban on exceptions > "in core functions" seems increasingly out-dated. This particular I agree. I think once we agreed we want to convert from fatals to exceptions, we need to recognize exceptions as a first-class citizen. Which means using it in internal functions is OK. Now, there is a big gap between E_WARNING on one side and E_ERROR/exception on the other side. Whether particular function crosses this gap or not is a case-by-case discussion, but "we can not use exceptions in core" should no longer be a part of it. > too quickly. I'm also a big fan of proper exception hierarchies - I've > seen so many times that you should never *catch* the base Exception > class, so *throwing* a base Exception seems very wrong to me. Agreed. Maybe we should have something like RuntimeException or Java? That is pretty generic too, but at least not Exception. -- Stas Malyshev smalyshev@gmail.com