Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87177 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9063 invoked from network); 15 Jul 2015 10:57:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2015 10:57:40 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:34474] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/81-27477-4AC36A55 for ; Wed, 15 Jul 2015 06:57:40 -0400 Received: by wibud3 with SMTP id ud3so77801901wib.1 for ; Wed, 15 Jul 2015 03:57:37 -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=uLP0m9XXGyEfNYFlhzR1NZsZ7xBBxFBBE9BhEDmidN0=; b=s8/pvQ6W7Yff3s/izrqfzelFWGU3KMC13Ei7xYJB8j7J+HjZf3mYduYodm1Yrbhhsu jlYe37PeDkawcZ4KLdU0er2vXDwjVF96Pun3WRGCJxDL1W6gu6fI2uhk0q1IlXnkbTsS 8QjlWG+BIhU3kJ7AXAvyJUvcZigytbcMPxujgmMasu2cRVAkCqmJUav/TuSznjt0NknV +N7DA0izCn3wJ5QawBNkFjC0MwL5FXLUFyaA7QNLaXhhcWUD6/vLFIpxYiHiuQNXz2V0 Yk9SUmtRQwMS8CZ+BD0Qsa0IFRUaehIhIdpBf0nUa26+tZptTpTsupSRSIKdtT4UOFRI hmqw== X-Received: by 10.194.108.5 with SMTP id hg5mr7537839wjb.25.1436957857148; Wed, 15 Jul 2015 03:57:37 -0700 (PDT) Received: from [192.168.0.136] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id b13sm2027541wic.15.2015.07.15.03.57.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 03:57:36 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <55A63C90.8000705@gmail.com> Date: Wed, 15 Jul 2015 11:57:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 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) Sammy Kaye Powers wrote on 14/07/2015 22:04: > Since the core functions in PHP don't throw Exceptions, there is debate on > whether or not this change should be implemented. Some say the CSPRNG's > should get a special pass since they will be relied on for cryptography. If > we can't throw Exceptions, there were suggestions of raising a fatal error > if the RNG fails. 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 function is in ext/standard, which is about as "core" as you can get, but it is a brand new function with no BC considerations and an explicit mandate to be as secure as possible. To me, using an exception here makes perfect sense, but I'm not sure how to formulate a policy that allows that without opening the floodgates 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. Regards, -- Rowan Collins [IMSoP]